diff --git a/.gitignore b/.gitignore index d4924fc3..aefe158b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ # aux files *.pyc *.swp + +# secrets +/django.secret diff --git a/mamweb/settings.py b/mamweb/settings.py index 368ca53c..e1b17817 100644 --- a/mamweb/settings.py +++ b/mamweb/settings.py @@ -1,3 +1,4 @@ +import os.path from .settings_common import * # Local development settings @@ -10,9 +11,6 @@ INSTALLED_APPS += ( 'django_extensions', ) -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = ')^u=i65*zmr_k53a*@f4q_+ji^o@!pgpef*5&8c7zzv9l+zo)n' - # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index 1d1fdda8..9012e13d 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -147,6 +147,16 @@ CKEDITOR_CONFIGS = { }, } + +# SECURITY WARNING: keep the secret key used in production secret! +# Create file 'django.secret' in every install (it is not kept in git) + +try: + with open(os.path.join(os.path.dirname(__file__), '..', 'django.secret')) as f: + SECRET_KEY = f.readline().strip() + except: + SECRET_KEY = ')^u=i65*zmr_k53a*@f4q_+ji^o@!pgpef*5&8c7zzdqwkdlkj' + # MaM specific SEMINAR_RESENI_DIR = os.path.join(BASE_DIR, 'media', 'reseni')