hosts.py 367 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
"""
We need to define ALLOWED_HOSTS in case of debug of if we're
locally running. If we have an env variable DJANGO_ALLOWED_HOSTS
defined, we can use it to.
"""

import os

from .env import DEBUG

if DEBUG:
    ALLOWED_HOSTS = ['*']
Okhin's avatar
Okhin committed
13
    INTERNAL_IPS = ('127.0.0.1',)
14
elif 'DJANGO_ALLOWED_HOSTS' in os.environ:
15
    ALLOWED_HOSTS = [os.environ['DJANGO_ALLOWED_HOSTS']]