Add SECRET_KEY to conf.py

Load secret key in settings.py from django.conf or os.env

Load secret key in settings.py from django.conf or os.env
This commit is contained in:
Martin Fitzpatrick 2015-08-13 15:53:50 +02:00
parent 99c77c8557
commit 261e721eb8
2 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,7 @@ for mod_name in MOCK_MODULES:
os.environ['DJANGO_SETTINGS_MODULE'] = 'wooey.settings'
os.environ['SECRET_KEY'] = 'not-so-secret'
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the

View File

@ -1,4 +1,5 @@
__author__ = 'chris'
import os
from django.conf import settings
from django.utils.translation import gettext_lazy as _
@ -18,3 +19,5 @@ WOOEY_EPHEMERAL_FILES = get('WOOEY_EPHEMERAL_FILES', False)
WOOEY_DEFAULT_SCRIPT_GROUP = get('WOOEY_DEFAULT_SCRIPT_GROUP', _('Scripts'))
WOOEY_SITE_NAME = get('WOOEY_SITE_NAME', _('Wooey!'))
WOOEY_SITE_TAG = get('WOOEY_SITE_TAG', _('A web UI for Python scripts'))
SECRET_KEY = get('SECRET_KEY', os.environ.get('SECRET_KEY', None))