Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fractalis
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Fractalis
fractalis
Commits
d11dcbc3
There was a problem fetching the pipeline mini graph.
Commit
d11dcbc3
authored
8 years ago
by
Sascha Herzinger
Browse files
Options
Downloads
Patches
Plain Diff
moved secret settings to seperate file and added loader
parent
95ed4a55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
fractalis/settings/base.py
+15
-20
15 additions, 20 deletions
fractalis/settings/base.py
with
16 additions
and
20 deletions
.gitignore
+
1
−
0
View file @
d11dcbc3
secrets.json
db.sqlite3
*.pyc
.coverage
This diff is collapsed.
Click to expand it.
fractalis/settings/base.py
+
15
−
20
View file @
d11dcbc3
"""
Django settings for fractalis project.
Generated by
'
django-admin startproject
'
using Django 1.9.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import
os
import
json
from
django.core.exceptions
import
ImproperlyConfigured
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
SECRETS_FILE
=
os
.
path
.
join
(
BASE_DIR
,
'
fractalis
'
,
'
settings
'
,
'
secrets.json
'
)
# Quick-start devel
op
m
en
t settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
with
open
(
SECRETS_FILE
)
as
f
:
secrets
=
json
.
loads
(
f
.
read
())
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'
1)3!n4xw*0rt*s3395$pcx8ocngr3g__0a$86@*xh56_f@*t86
'
def
get_secret
(
setting
,
secrets
=
secrets
):
"""
Get the secret variable or return excplicit exception.
"""
try
:
return
secrets
[
setting
]
except
KeyError
:
error_msg
=
"
Variable {0} not found in
'
secrets.json
'"
.
format
(
setting
)
raise
ImproperlyConfigured
(
error_msg
)
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
SECRET_KEY
=
get_secret
(
"
SECRET_KEY
"
)
ALLOWED_HOSTS
=
[]
# Application definition
INSTALLED_APPS
=
[
...
...
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