From c599f233b17d3890df8f648f8ead25141c21495c Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Fri, 28 Nov 2014 23:04:19 +0100 Subject: [PATCH] Added a comment about the last use of Engine.get_default(). --- django/template/base.py | 4 ++++ 1 file changed, 4 insertions(+) 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()