Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Jacek Lebioda
aai-python-social-auth
Commits
c3cb5749
Commit
c3cb5749
authored
Aug 30, 2019
by
Jacek Lebioda
Browse files
Using secret from separate file
parent
efb02fc1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
1 deletion
+15
-1
.gitignore
.gitignore
+5
-0
app/app/secret.py.template
app/app/secret.py.template
+2
-0
app/app/secret.py.template.py
app/app/secret.py.template.py
+0
-0
app/app/settings.py
app/app/settings.py
+8
-1
No files found.
.gitignore
View file @
c3cb5749
.idea/*
app/secret.py
env/*
venv/*
db.sqlite3
\ No newline at end of file
app/app/secret.py.template
0 → 100644
View file @
c3cb5749
# 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
app/app/secret.py.template.py
deleted
100644 → 0
View file @
efb02fc1
app/app/settings.py
View file @
c3cb5749
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment