Add django-environ and use it to set ALLOWED_HOSTS.
Signed-off-by: Eric Riggs <ericriggs42@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ INSTALL_FLAG=/var/lib/mayan/media/system/SECRET_KEY
|
||||
|
||||
export MAYAN_MEDIA_ROOT=/var/lib/mayan
|
||||
export MAYAN_GUNICORN_WORKERS=${MAYAN_GUNICORN_WORKERS:-3}
|
||||
export MAYAN_ALLOWED_HOSTS=*
|
||||
|
||||
chown mayan:mayan /var/lib/mayan -R
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ django-colorful==1.2
|
||||
django-compressor==2.2
|
||||
django-cors-headers==2.2.0
|
||||
django-downloadview==1.9
|
||||
django-environ==0.4.4
|
||||
django-formtools==2.1
|
||||
django-pure-pagination==0.3.0
|
||||
django-mathfilters==0.4.0
|
||||
|
||||
Reference in New Issue
Block a user