mirror of
https://github.com/django/django.git
synced 2025-12-15 21:45:20 +00:00
Refs #27175 -- Removed exception silencing from the {% include %} template tag.
Per deprecation timeline.
This commit is contained in:
parent
96107e2844
commit
e62165b898
6 changed files with 37 additions and 161 deletions
|
|
@ -711,21 +711,6 @@ available to the included template::
|
|||
|
||||
{% 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. When debug mode
|
||||
is turned off, ``{% include %}`` logs a warning to the ``django.template``
|
||||
logger with the exception that happens while rendering the included template
|
||||
and returns an empty string.
|
||||
|
||||
.. deprecated:: 1.11
|
||||
|
||||
Silencing exceptions raised while rendering the ``{% include %}`` template
|
||||
tag is deprecated. In Django 2.1, the exception will be raised.
|
||||
|
||||
.. note::
|
||||
The :ttag:`include` tag should be considered as an implementation of
|
||||
"render this subtemplate and include the HTML", not as "parse this
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue