summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBouke Haarsma <bouke@webatoom.nl>2013-10-14 14:43:55 +0200
committerTim Graham <timograham@gmail.com>2013-10-14 11:55:15 -0400
commit7f62d794b303bedfd094742a84dcc8b85df3ba8b (patch)
tree8a1c88b68124d4004b8bf755de550c018f886d8e
parent5c1be8a870f9783c4164cf09b1e9db3205ad1f1e (diff)
[1.5.x] Fixed #20962 -- Documented that template tag render() may raise exceptions.
Thanks Keryn Knight for the report. Backport of e077224f4a from master
-rw-r--r--AUTHORS1
-rw-r--r--docs/howto/custom-template-tags.txt8
2 files changed, 7 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index 357533d7bc..7ad0938cce 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -236,6 +236,7 @@ answer newbie questions, and generally made Django that much better:
Janos Guljas
Thomas Güttler <hv@tbz-pariv.de>
Horst Gutmann <zerok@zerokspot.com>
+ Bouke Haarsma <bouke@haarsma.eu>
Antti Haapala <antti@industrialwebandmagic.com>
Scot Hacker <shacker@birdhouse.org>
dAniel hAhler
diff --git a/docs/howto/custom-template-tags.txt b/docs/howto/custom-template-tags.txt
index 30bb6b120e..d7f760faaf 100644
--- a/docs/howto/custom-template-tags.txt
+++ b/docs/howto/custom-template-tags.txt
@@ -495,8 +495,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