Set ALLOWED_HOSTS correctly based on base hostname

This commit is contained in:
Jake Howard 2022-09-04 16:52:05 +01:00
parent d93bc2450d
commit b167cd4ca4
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -21,7 +21,8 @@ DEBUG = env("DEBUG")
SECRET_KEY = env("SECRET_KEY") SECRET_KEY = env("SECRET_KEY")
ALLOWED_HOSTS = ["*"] BASE_HOSTNAME = env("BASE_HOSTNAME")
ALLOWED_HOSTS = ["*"] if DEBUG else [BASE_HOSTNAME]
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
@ -200,7 +201,6 @@ WAGTAILSEARCH_BACKENDS = {
} }
} }
BASE_HOSTNAME = env("BASE_HOSTNAME")
WAGTAILADMIN_BASE_URL = f"https://{BASE_HOSTNAME}" WAGTAILADMIN_BASE_URL = f"https://{BASE_HOSTNAME}"
WAGTAIL_FRONTEND_LOGIN_URL = "/admin/login/" WAGTAIL_FRONTEND_LOGIN_URL = "/admin/login/"