diff options
| author | Bouke Haarsma <bouke@webatoom.nl> | 2013-10-14 14:43:55 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-10-14 11:55:12 -0400 |
| commit | 7f566fdb4c8453c8fa4b44d0fe5cc28472acc2ff (patch) | |
| tree | bb80e4327cee0fb349f2cef5dbfd8977a34605ab /docs | |
| parent | 8222a48253e61f4d3c1d30156a5f9e0d59a7c56c (diff) | |
[1.6.x] Fixed #20962 -- Documented that template tag render() may raise exceptions.
Thanks Keryn Knight for the report.
Backport of e077224f4a from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/custom-template-tags.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/howto/custom-template-tags.txt b/docs/howto/custom-template-tags.txt index 35f78718e4..a4cb031d47 100644 --- a/docs/howto/custom-template-tags.txt +++ b/docs/howto/custom-template-tags.txt @@ -477,8 +477,12 @@ Notes: * The ``render()`` method is where the work actually happens. -* ``render()`` should never raise ``TemplateSyntaxError`` or any other - exception. It should fail silently, just as template filters should. +* ``render()`` should generally fail silently, particularly in a production + environment where :setting:`DEBUG` and :setting:`TEMPLATE_DEBUG` are + ``False``. In some cases however, particularly if :setting:`TEMPLATE_DEBUG` is + ``True``, this method may raise an exception to make debugging easier. For + example, several core tags raise ``django.template.TemplateSyntaxError`` + if they receive the wrong number or type of arguments. Ultimately, this decoupling of compilation and rendering results in an efficient template system, because a template can render multiple contexts |
