summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-09-03 09:06:33 -0400
committerGitHub <noreply@github.com>2016-09-03 09:06:33 -0400
commit277fe2e8f2ee35cd389b079ce7691491bb5738ec (patch)
tree22f68b9207297232dc65dccbd2c958ff19f89fa3 /django
parent2ced2f785d5aca0354abf5841d5449b7a49509dc (diff)
Fixed #25788 -- Enabled the cached template loader if debug is False.
Diffstat (limited to 'django')
-rw-r--r--django/template/engine.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/template/engine.py b/django/template/engine.py
index b49ed09088..729c484a67 100644
--- a/django/template/engine.py
+++ b/django/template/engine.py
@@ -27,6 +27,8 @@ class Engine(object):
loaders = ['django.template.loaders.filesystem.Loader']
if app_dirs:
loaders += ['django.template.loaders.app_directories.Loader']
+ if not debug:
+ loaders = [('django.template.loaders.cached.Loader', loaders)]
else:
if app_dirs:
raise ImproperlyConfigured(