diff --git a/src/moore/settings/base.py b/src/moore/settings/base.py index 49f6ad17..ddc4117a 100644 --- a/src/moore/settings/base.py +++ b/src/moore/settings/base.py @@ -69,7 +69,7 @@ 'captcha', 'jsonschemaform', 'django_select2', # Custom select2 widget - 'django_hosts', # Subdomains for admin site + 'django_hosts', # Subdomain for admin site 'django.contrib.admin', # Used for wagtail admin filters 'django.contrib.auth', @@ -80,7 +80,8 @@ ] MIDDLEWARE = [ - 'django_hosts.middleware.HostsRequestMiddleware', # Needed django_hosts + # Subdomain for admin site. Needed by django_hosts + 'django_hosts.middleware.HostsRequestMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -91,7 +92,8 @@ 'django.middleware.locale.LocaleMiddleware', 'wagtail.contrib.redirects.middleware.RedirectMiddleware', - 'django_hosts.middleware.HostsResponseMiddleware', # Needed django_hosts + # Subdomain for admin site. Needed by django_hosts + 'django_hosts.middleware.HostsResponseMiddleware', ] DATABASES = { @@ -106,7 +108,9 @@ } ROOT_URLCONF = 'moore.urls' +# Needed for django hosts, enables us to publish wagtail admin on subdomain. ROOT_HOSTCONF = 'moore.settings.hosts' +DEFAULT_HOST = 'default' TEMPLATES = [ diff --git a/src/moore/settings/dev.py b/src/moore/settings/dev.py index f736853b..7939ef09 100644 --- a/src/moore/settings/dev.py +++ b/src/moore/settings/dev.py @@ -51,7 +51,6 @@ # backend - e.g. in notification emails. Don't include '/admin' or a # trailing slash BASE_URL = 'http://localhost:8000' -DEFAULT_HOST = 'www' ALLOWED_HOSTS = ['admin.localhost', 'localhost'] # Email diff --git a/src/moore/settings/hosts.py b/src/moore/settings/hosts.py index 9743f07b..ff68aa72 100644 --- a/src/moore/settings/hosts.py +++ b/src/moore/settings/hosts.py @@ -3,6 +3,6 @@ host_patterns = patterns( '', - host(r'www', settings.ROOT_URLCONF, name='www'), + host(r'', settings.ROOT_URLCONF, name='default'), host(r'admin', 'admin.urls', name='admin'), )