summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-11-28 23:04:19 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-12-28 17:00:07 +0100
commitc599f233b17d3890df8f648f8ead25141c21495c (patch)
tree2a9a49616b5d75ba420b52047552841b74fa0486
parent969e082858339b8da79af2c036d434ce91c27ee0 (diff)
Added a comment about the last use of Engine.get_default().
-rw-r--r--django/template/base.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/template/base.py b/django/template/base.py
index 3d538cb69e..8a0b638a54 100644
--- a/django/template/base.py
+++ b/django/template/base.py
@@ -176,6 +176,10 @@ class Template(object):
except UnicodeDecodeError:
raise TemplateEncodingError("Templates can only be constructed "
"from unicode or UTF-8 strings.")
+ # If Template is instantiated directly rather than from an Engine and
+ # exactly one Django template engine is configured, use that engine.
+ # This is required to preserve backwards-compatibility for direct use
+ # e.g. Template('...').render(Context({...}))
if engine is None:
from .engine import Engine
engine = Engine.get_default()