Commit c3cb5749 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Using secret from separate file

parent efb02fc1
.idea/*
app/secret.py
env/*
venv/*
db.sqlite3
\ No newline at end of file
# Don't forget to change it's value!
SECRET_KEY = 'g_(!r=swvi12gi)j+))3uj^4)ed)+p+%o^97(25#^f7f77t@4v'
\ No newline at end of file
......@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
import sys
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
......@@ -20,7 +21,13 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'g_(!r=swvi12gi)j+))3uj^4)ed)+p+%o^97(25#^f7f77t@4v'
try:
from .secret import SECRET_KEY
except ImportError:
print("\n", file=sys.stderr)
print(" ! You did not create secret.py file inside ./app/ directory!", file=sys.stderr)
print(" To start, just use the secret.py.template file (and change the secret key)", file=sys.stderr)
print("\n\n", file=sys.stderr)
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
......
Markdown is supported
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