Skip to content
Browse files

[1.6.x] Fixed #20962 -- Documented that template tag render() may rai…

…se exceptions.

Thanks Keryn Knight for the report.

Backport of e077224 from master
  • Loading branch information...
1 parent 8222a48 commit 7f566fdb4c8453c8fa4b44d0fe5cc28472acc2ff @Bouke Bouke committed with timgraham
Showing with 7 additions and 2 deletions.
  1. +1 −0 AUTHORS
  2. +6 −2 docs/howto/custom-template-tags.txt
@@ -268,6 +268,7 @@ answer newbie questions, and generally made Django that much better:
Janos Guljas
Thomas Güttler <>
Horst Gutmann <>
+ Bouke Haarsma <>
Antti Haapala <>
Scot Hacker <>
dAniel hAhler
8 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

0 comments on commit 7f566fd

Please sign in to comment.
Something went wrong with that request. Please try again.