Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Maximilian Michal
grady
Commits
6704cf38
There was a problem fetching the pipeline summary.
Verified
Commit
6704cf38
authored
7 years ago
by
Jan Maximilian Michal
Browse files
Options
Downloads
Patches
Plain Diff
Always using a random secret key
parent
e7e725f2
No related branches found
No related tags found
1 merge request
!50
Always using a random secret key
Pipeline
#
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
grady/settings/default.py
+17
-1
17 additions, 1 deletion
grady/settings/default.py
with
18 additions
and
1 deletion
.gitignore
+
1
−
0
View file @
6704cf38
...
@@ -37,3 +37,4 @@ anon-export/
...
@@ -37,3 +37,4 @@ anon-export/
# node
# node
node_modules
node_modules
secret
This diff is collapsed.
Click to expand it.
grady/settings/default.py
+
17
−
1
View file @
6704cf38
...
@@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/1.10/ref/settings/
...
@@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/1.10/ref/settings/
import
datetime
import
datetime
import
os
import
os
import
secrets
import
string
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
...
@@ -21,7 +23,21 @@ BASE_DIR = os.path.dirname(os.path.dirname(
...
@@ -21,7 +23,21 @@ BASE_DIR = os.path.dirname(os.path.dirname(
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'
#1s$0+&d3c2&)t_1!4%uopgl)ewvs&wo+j+_22#f5&)8daglp)
'
try
:
SECRET_KEY
except
NameError
:
SECRET_FILE
=
'
secret
'
try
:
SECRET_KEY
=
open
(
SECRET_FILE
).
read
().
strip
()
except
IOError
:
try
:
SECRET_KEY
=
''
.
join
(
secrets
.
choice
(
string
.
printable
)
for
i
in
range
(
50
))
with
open
(
SECRET_FILE
,
'
w
'
)
as
secret
:
secret
.
write
(
SECRET_KEY
)
except
IOError
:
Exception
(
'
Please create a %s file with random characters
\
to generate your secret key!
'
%
SECRET_FILE
)
# SECURITY WARNING: don't run with debug turned on in production!
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
DEBUG
=
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment