Django Subdomains is a package aimed at allowing subdomains to be used with the django webframework
The package works by placing a subdomain urlconfs in your settings:
SUBDOMAIN_URLCONFS = {
None: 'myproject.urls.frontend', # no subdomain, e.g. ``example.com``
'www': 'myproject.urls.frontend',
'api': 'myproject.urls.api',
}
With a key per subdomain.
Other utilities are provided for reversing urls on subdomains.