settings: defer SECRET_KEY until after site settings

This allows overriding just `SECRET_FILE` for a custom secret path.
This commit is contained in:
Ben Boeckel committed 2018-10-30 10:13:53 -04:00
1 parent 872af56e2c
commit e02fa53c34
1 file changed
+3 -1
+3 -1
View File
@@ -24,7 +24,6 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See secret.py for how this is generated; uses a file 'secret.txt' in the root
# directory
SECRET_FILE = os.path.join(BASE_DIR, "secret.txt")
SECRET_KEY = get_secret_from_file(SECRET_FILE)
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
@@ -142,3 +141,6 @@ try:
from etesync_site_settings import *
except ImportError:
pass
if 'SECRET_KEY' not in locals():
SECRET_KEY = get_secret_from_file(SECRET_FILE)