Open utkbansal opened 9 years ago
The temporary solution that I could come up with is -
add a new file called admin_urls.py along you root urlconf
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'', include(admin.site.urls)),
]
and then in hosts.py
from django_hosts import patterns, host
from django.conf import settings
host_patterns = patterns(
'',
host(r'admin', 'subdomain.admin_urls', name='admin'),
host(r'www', settings.ROOT_URLCONF, name='www'),
)
Is there a better way to do this?
Also there is no 404 showing up if I hit a non existent subdomain. Eg- If I open up a.mysite.com, it shows up what mysite.com would show up.
The default admin app doesn't have a urls.py in it. So how can I use the admin site at admin.mysite.com ? What will be in the hosts.py?