Add django-environ and use it to set ALLOWED_HOSTS.
Signed-off-by: Eric Riggs <ericriggs42@gmail.com>
This commit is contained in:
@@ -16,10 +16,14 @@ import sys
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
import environ
|
||||
|
||||
import mayan
|
||||
|
||||
from .literals import DEFAULT_SECRET_KEY, SECRET_KEY_FILENAME, SYSTEM_DIR
|
||||
|
||||
env = environ.Env()
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
@@ -33,7 +37,7 @@ SECRET_KEY = DEFAULT_SECRET_KEY
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '[::1]']
|
||||
ALLOWED_HOSTS = env.list('MAYAN_ALLOWED_HOSTS', default=['127.0.0.1', 'localhost', '[::1]'])
|
||||
|
||||
# Application definition
|
||||
|
||||
|
||||
Reference in New Issue
Block a user