mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Added a comment about the last use of Engine.get_default().
This commit is contained in:
parent
969e082858
commit
c599f233b1
@ -176,6 +176,10 @@ class Template(object):
|
|||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
raise TemplateEncodingError("Templates can only be constructed "
|
raise TemplateEncodingError("Templates can only be constructed "
|
||||||
"from unicode or UTF-8 strings.")
|
"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:
|
if engine is None:
|
||||||
from .engine import Engine
|
from .engine import Engine
|
||||||
engine = Engine.get_default()
|
engine = Engine.get_default()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user