Kaydet (Commit) fc3409b0 authored tarafından Andrei Kulakov's avatar Andrei Kulakov Kaydeden (comit) Tim Graham

Fixed #24813 -- Documented {% include %} debug behavior variance

üst 016d8cfb
...@@ -699,6 +699,15 @@ available to the included template:: ...@@ -699,6 +699,15 @@ available to the included template::
{% include "name_snippet.html" with greeting="Hi" only %} {% include "name_snippet.html" with greeting="Hi" only %}
If the included template causes an exception while it's rendered (including
if it's missing or has syntax errors), the behavior varies depending on the
:class:`template engine's <django.template.Engine>` ``debug`` option (if not
set, this option defaults to the value of :setting:`DEBUG`). When debug mode is
turned on, an exception like :exc:`~django.template.TemplateDoesNotExist` or
:exc:`~django.template.TemplateSyntaxError` will be raised; otherwise
``{% include %}`` silences any exception that happens while rendering the
included template and returns an empty string.
.. note:: .. note::
The :ttag:`include` tag should be considered as an implementation of The :ttag:`include` tag should be considered as an implementation of
"render this subtemplate and include the HTML", not as "parse this "render this subtemplate and include the HTML", not as "parse this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment