Added www allowed domain, RedisCache optional

This commit is contained in:
Oleg Lavrovsky 2017-10-12 14:21:39 +02:00
parent 01619a73df
commit da425fcf0b
2 changed files with 1 additions and 15 deletions

View File

@ -13,7 +13,7 @@ web:
- "5000:5000"
environment:
- DJANGO_SETTINGS_MODULE={{ django_project_name }}.settings.production
- ALLOWED_HOSTS={{ domain }},{{ ipv4_addresses|join(':5000,') }}
- ALLOWED_HOSTS={{ domain }},www.{{ domain }},{{ ipv4_addresses|join(':5000,') }}
- SECRET_KEY={{ django_secret_key }}
- MAILGUN_KEY={{ django_email_key }}
- MAILGUN_DOMAIN={{ django_email_domain }}

View File

@ -97,19 +97,6 @@ if 'MAILGUN_KEY' in os.environ:
}
DEFAULT_FROM_EMAIL = env['MAILGUN_FROM']
# Use Redis as the cache backend for extra performance
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': '127.0.0.1:6379',
'KEY_PREFIX': 'publichealth',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
}
}
}
# Redis location can either be passed through with REDIS_HOST or REDIS_SOCKET
if 'REDIS_URL' in env:
@ -127,7 +114,6 @@ elif 'REDIS_SOCKET' in env:
else:
REDIS_LOCATION = None
if REDIS_LOCATION is not None:
CACHES = {
'default': {