Skip to content

Commit

Permalink
Fixed configs so default is used
Browse files Browse the repository at this point in the history
  • Loading branch information
hato1883 committed Jan 23, 2024
1 parent dff2e4d commit 2a6cbbf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/moore/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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 = {
Expand All @@ -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 = [
Expand Down
1 change: 0 additions & 1 deletion src/moore/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/moore/settings/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
)

0 comments on commit 2a6cbbf

Please sign in to comment.