summaryrefslogtreecommitdiff
path: root/django/template/base.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-11-22 21:33:40 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-11-23 11:54:17 +0100
commit6294bd3903e12507c4e70e012dade82d0f52c388 (patch)
tree5756d5318c51ccd589d3a3c69a928843a72541e2 /django/template/base.py
parent47a131b9446eb9b31e57554f17310bc2fd43a26f (diff)
Encapsulated TEMPLATE_DEBUG in Engine.
Diffstat (limited to 'django/template/base.py')
-rw-r--r--django/template/base.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/template/base.py b/django/template/base.py
index 85bafdd3b4..22e411270d 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -7,7 +7,6 @@ from inspect import getargspec, getcallargs
import warnings
from django.apps import apps
-from django.conf import settings
from django.template.context import (BaseContext, Context, RequestContext, # NOQA: imported for backwards compatibility
ContextPopException)
from django.utils import lru_cache
@@ -126,11 +125,11 @@ class Template(object):
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed "
"from unicode or UTF-8 strings.")
- if settings.TEMPLATE_DEBUG and origin is None:
- origin = StringOrigin(template_string)
if engine is None:
from .engine import Engine
engine = Engine.get_default()
+ if engine.debug and origin is None:
+ origin = StringOrigin(template_string)
self.nodelist = engine.compile_string(template_string, origin)
self.name = name
self.origin = origin