Skip to content

Commit f04cf65

Browse files
committed
Fixed missing SECRET_KEY issue for docs generation.
1 parent 86301ea commit f04cf65

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

docs/conf.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919
# documentation root, use os.path.abspath to make it absolute, like shown here.
2020
#sys.path.insert(0, os.path.abspath('.'))
2121
sys.path.insert(0, os.path.abspath('..'))
22+
# create local_settings.py for SECRET_KEY if necessary
23+
local_settings_path = os.path.abspath(
24+
os.path.join('..', 'deis', 'local_settings.py'))
25+
if not os.path.exists(local_settings_path):
26+
with open(local_settings_path, 'w') as local_settings:
27+
local_settings.write("SECRET_KEY = 'DummySecretKey'\n")
2228
# set up Django
2329
os.environ['DJANGO_SETTINGS_MODULE'] = 'deis.settings'
24-
from django.conf import settings
25-
if not settings.SECRET_KEY:
26-
settings.SECRET_KEY = 'TotallyFake-SECRET_KEY-ForSphinxDocs'
30+
from django.conf import settings # noqa
2731

2832
# -- General configuration -----------------------------------------------------
2933

0 commit comments

Comments
 (0)