diff options
author | 2021-06-08 00:26:40 +0200 | |
---|---|---|
committer | 2021-06-08 00:29:59 +0200 | |
commit | c998d475440cf4819bad7ebc3ed19f31ce82baf4 (patch) | |
tree | bfdeba9a483ebb7646171c79f5b259c27f3d17dd /pydis_site/settings.py | |
parent | Fix `content` app tests not running on macOS (#519) (diff) |
Move subdomains to query paths.
In more detail:
- Use Django URL namespaces (e.g. `api:bot:infractions`) instead of
`django_hosts` host argument.
- Update the hosts file setup documentation to remove subdomain entries.
- Update the hosts file setup documentation to mention that the entry of
`pythondiscord.local` is not required and mainly for convenience.
- Rename the `APISubdomainTestCase` to the more fitting
`AuthenticatedAPITestCase`, as authentication is all that is left that the
class is doing.
- Drop dependency to `django_hosts`.
Diffstat (limited to 'pydis_site/settings.py')
-rw-r--r-- | pydis_site/settings.py | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 7df7ad85..f7c4401d 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -52,13 +52,7 @@ elif 'CI' in os.environ: else: ALLOWED_HOSTS = env.list( 'ALLOWED_HOSTS', - default=[ - 'pythondiscord.com', - 'admin.pythondiscord.com', - 'api.pythondiscord.com', - 'staff.pythondiscord.com', - 'pydis-api.default.svc.cluster.local', - ] + default=['pythondiscord.com'], ) SECRET_KEY = env('SECRET_KEY') @@ -80,7 +74,6 @@ INSTALLED_APPS = [ 'django.contrib.sites', 'django.contrib.staticfiles', - 'django_hosts', 'django_filters', 'django_simple_bulma', 'rest_framework', @@ -88,8 +81,6 @@ INSTALLED_APPS = [ ] MIDDLEWARE = [ - 'django_hosts.middleware.HostsRequestMiddleware', - 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -98,8 +89,6 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - - 'django_hosts.middleware.HostsResponseMiddleware', ] ROOT_URLCONF = 'pydis_site.urls' @@ -109,10 +98,6 @@ TEMPLATES = [ 'DIRS': [os.path.join(BASE_DIR, 'pydis_site', 'templates')], 'APP_DIRS': True, 'OPTIONS': { - 'builtins': [ - 'django_hosts.templatetags.hosts_override', - ], - 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', @@ -174,11 +159,6 @@ STATICFILES_FINDERS = [ 'django_simple_bulma.finders.SimpleBulmaFinder', ] -# django-hosts -# https://django-hosts.readthedocs.io/en/latest/ -ROOT_HOSTCONF = 'pydis_site.hosts' -DEFAULT_HOST = 'home' - if DEBUG: PARENT_HOST = env('PARENT_HOST', default='pythondiscord.local:8000') |