Commit 5b83ab1e authored by isillitoe's avatar isillitoe
Browse files

provide random secret key if no file

parent c8a08d87
...@@ -12,6 +12,9 @@ https://docs.djangoproject.com/en/1.11/ref/settings/ ...@@ -12,6 +12,9 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
import logging.config # pylint: disable=C0413,C0411 import logging.config # pylint: disable=C0413,C0411
import os import os
from django.core.management.utils import get_random_secret_key
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.integrations.django import DjangoIntegration
...@@ -31,8 +34,11 @@ for secret_dir in [BASE_DIR, '/etc']: ...@@ -31,8 +34,11 @@ for secret_dir in [BASE_DIR, '/etc']:
continue continue
if not SECRET_KEY: if not SECRET_KEY:
raise FileNotFoundError( SECRET_KEY = get_random_secret_key()
'failed to get SECRET_KEY from local file, tried: {}'.format(", ".join(secret_files))) # raise FileNotFoundError(
# 'failed to get SECRET_KEY from local file, tried: {}'.format(", ".join(secret_files)))
del secret_files del secret_files
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment