diff options
author | 2019-09-28 22:40:14 +1000 | |
---|---|---|
committer | 2019-09-28 22:40:14 +1000 | |
commit | 7f8468ecdb2bc2820755e9b4bf9f213f1e8d0908 (patch) | |
tree | 50ba9bce4b74103633212eb5830529a777455b8d | |
parent | Automatically create a default bot api token for dev. (diff) |
Support internal docker network DNS resolution & dev ALLOWED_HOSTS env var.
-rw-r--r-- | docker-compose.yml | 6 | ||||
-rw-r--r-- | pydis_site/settings.py | 19 |
2 files changed, 19 insertions, 6 deletions
diff --git a/docker-compose.yml b/docker-compose.yml index 71a5593f..3a2e5398 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,12 @@ services: context: . dockerfile: docker/Dockerfile command: ["run", "--debug"] + networks: + default: + aliases: + - api.web + - admin.web + - staff.web ports: - "127.0.0.1:8000:8000" depends_on: diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 3f6cd94a..4534f54b 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -30,12 +30,19 @@ DEBUG = env('DEBUG') # SECURITY WARNING: keep the secret key used in production secret! if DEBUG: - ALLOWED_HOSTS = [ - 'pythondiscord.local', - 'admin.pythondiscord.local', - 'api.pythondiscord.local', - 'staff.pythondiscord.local', - ] + ALLOWED_HOSTS = env.list( + 'ALLOWED_HOSTS', + default=[ + 'pythondiscord.local', + 'api.pythondiscord.local', + 'admin.pythondiscord.local', + 'staff.pythondiscord.local', + 'web', + 'api.web', + 'admin.web', + 'staff.web' + ] + ) SECRET_KEY = secrets.token_urlsafe(32) elif 'CI' in os.environ: |