Can now configure allowed host in all settings

This commit is contained in:
Eliot Berriot 2018-02-18 14:28:44 +01:00
parent c0724d3cb4
commit 2f8a026afa
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
4 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,7 @@ test_api:
paths: paths:
- "$PIP_CACHE_DIR" - "$PIP_CACHE_DIR"
variables: variables:
DJANGO_ALLOWED_HOSTS: "localhost"
DATABASE_URL: "postgresql://postgres@postgres/postgres" DATABASE_URL: "postgresql://postgres@postgres/postgres"
before_script: before_script:

View File

@ -23,6 +23,10 @@ try:
env.read_env(ROOT_DIR.file('.env')) env.read_env(ROOT_DIR.file('.env'))
except FileNotFoundError: except FileNotFoundError:
pass pass
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS')
# APP CONFIGURATION # APP CONFIGURATION
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
DJANGO_APPS = ( DJANGO_APPS = (

View File

@ -54,7 +54,6 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Hosts/domain names that are valid for this site # Hosts/domain names that are valid for this site
# See https://docs.djangoproject.com/en/1.6/ref/settings/#allowed-hosts # See https://docs.djangoproject.com/en/1.6/ref/settings/#allowed-hosts
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS')
CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
# END SITE CONFIGURATION # END SITE CONFIGURATION

View File

@ -10,6 +10,7 @@ services:
volumes: volumes:
- .:/app - .:/app
environment: environment:
- "DJANGO_ALLOWED_HOSTS=localhost"
- "DATABASE_URL=postgresql://postgres@postgres/postgres" - "DATABASE_URL=postgresql://postgres@postgres/postgres"
postgres: postgres:
image: postgres image: postgres