Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
TO
Helios Server
Commits
dc1b3031
Unverified
Commit
dc1b3031
authored
6 years ago
by
Marco Ciotola
Browse files
Options
Downloads
Patches
Plain Diff
[DJ1.10] Redefine template settings
parent
6c65968c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
settings.py
+21
-13
21 additions, 13 deletions
settings.py
with
21 additions
and
13 deletions
settings.py
+
21
−
13
View file @
dc1b3031
import
os
,
json
# a massive hack to see if we're testing, in which case we use different settings
# a massive hack to see if we're testing, in which case we use different settings
import
sys
import
sys
import
json
import
os
TESTING
=
'
test
'
in
sys
.
argv
TESTING
=
'
test
'
in
sys
.
argv
# go through environment variables and override them
# go through environment variables and override them
...
@@ -13,7 +15,6 @@ def get_from_env(var, default):
...
@@ -13,7 +15,6 @@ def get_from_env(var, default):
return
default
return
default
DEBUG
=
(
get_from_env
(
'
DEBUG
'
,
'
1
'
)
==
'
1
'
)
DEBUG
=
(
get_from_env
(
'
DEBUG
'
,
'
1
'
)
==
'
1
'
)
TEMPLATE_DEBUG
=
DEBUG
# add admins of the form:
# add admins of the form:
# ('Ben Adida', 'ben@adida.net'),
# ('Ben Adida', 'ben@adida.net'),
...
@@ -113,12 +114,6 @@ if (get_from_env('HSTS', '0') == '1'):
...
@@ -113,12 +114,6 @@ if (get_from_env('HSTS', '0') == '1'):
SECURE_BROWSER_XSS_FILTER
=
True
SECURE_BROWSER_XSS_FILTER
=
True
SECURE_CONTENT_TYPE_NOSNIFF
=
True
SECURE_CONTENT_TYPE_NOSNIFF
=
True
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS
=
(
'
django.template.loaders.filesystem.Loader
'
,
'
django.template.loaders.app_directories.Loader
'
)
MIDDLEWARE_CLASSES
=
(
MIDDLEWARE_CLASSES
=
(
# make all things SSL
# make all things SSL
#'sslify.middleware.SSLifyMiddleware',
#'sslify.middleware.SSLifyMiddleware',
...
@@ -136,10 +131,23 @@ MIDDLEWARE_CLASSES = (
...
@@ -136,10 +131,23 @@ MIDDLEWARE_CLASSES = (
ROOT_URLCONF
=
'
urls
'
ROOT_URLCONF
=
'
urls
'
ROOT_PATH
=
os
.
path
.
dirname
(
__file__
)
ROOT_PATH
=
os
.
path
.
dirname
(
__file__
)
TEMPLATE_DIRS
=
(
TEMPLATES
=
[
{
'
BACKEND
'
:
'
django.template.backends.django.DjangoTemplates
'
,
'
APP_DIRS
'
:
True
,
'
DIRS
'
:
[
ROOT_PATH
,
ROOT_PATH
,
os
.
path
.
join
(
ROOT_PATH
,
'
templates
'
)
os
.
path
.
join
(
ROOT_PATH
,
'
templates
'
),
)
# os.path.join(ROOT_PATH, 'helios/templates'), # covered by APP_DIRS:True
# os.path.join(ROOT_PATH, 'helios_auth/templates'), # covered by APP_DIRS:True
# os.path.join(ROOT_PATH, 'server_ui/templates'), # covered by APP_DIRS:True
],
'
OPTIONS
'
:
{
'
debug
'
:
DEBUG
}
},
]
INSTALLED_APPS
=
(
INSTALLED_APPS
=
(
'
django.contrib.auth
'
,
'
django.contrib.auth
'
,
...
...
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