Skip to content

Commit

Permalink
TEMPLATE_LOADERS is now catered for by TEMPLATES
Browse files Browse the repository at this point in the history
  • Loading branch information
ghickman committed Mar 9, 2018
1 parent 9ac3ec5 commit b10df86
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions opal/scaffolding/scaffold/app/settings.py.jinja2
Expand Up @@ -60,24 +60,10 @@ MIDDLEWARE_CLASSES = [

ROOT_URLCONF = '{{ name }}.urls'

if DEBUG:
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
else:
TEMPLATE_LOADERS = (
('django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)),
)

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(PROJECT_PATH, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'debug': DEBUG,
'context_processors': [
Expand All @@ -93,6 +79,14 @@ TEMPLATES = [
'opal.context_processors.models',
'opal.core.pathway.context_processors.pathways',
],
'loaders': [(
# TODO: Django 1.11 makes turns this loader on by default, so
# this section and `debug` can be removed then.
'django.template.loaders.cached.Loader', [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
],
)],
},
},
]
Expand Down

0 comments on commit b10df86

Please sign in to comment.