diff options
| author | Andrei Kulakov <andrei.avk@gmail.com> | 2015-05-18 17:13:16 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-05-21 19:52:32 -0400 |
| commit | 5a0e39b2d5a0807bd25e17ac9eb1fd9165da6d55 (patch) | |
| tree | fd865a27d7de23241f65a1709f95d3d9f4d79738 /docs/ref | |
| parent | d3a8ce76582ac21673c991016c746682f388445b (diff) | |
[1.8.x] Fixed #24813 -- Documented {% include %} debug behavior variance
Backport of fc3409b0932959f2aca42715e9147113d0e40f79 from master
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index b1d24c8c09..aa7b4dd0ee 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -695,6 +695,15 @@ 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; otherwise +``{% include %}`` silences any exception that happens while rendering the +included template and returns an empty string. + .. note:: The :ttag:`include` tag should be considered as an implementation of "render this subtemplate and include the HTML", not as "parse this |
