Browse Source

Added a comment about the last use of Engine.get_default().

Aymeric Augustin 10 years ago
parent
commit
c599f233b1
1 changed files with 4 additions and 0 deletions
  1. 4 0
      django/template/base.py

+ 4 - 0
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()