Skip to content
Snippets Groups Projects
Unverified Commit dc1b3031 authored by Marco Ciotola's avatar Marco Ciotola
Browse files

[DJ1.10] Redefine template settings

parent 6c65968c
No related branches found
No related tags found
No related merge requests found
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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment