Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.5.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...
commit 7f62d794b303bedfd094742a84dcc8b85df3ba8b 1 parent 5c1be8a
Bouke Haarsma authored timgraham committed
1  AUTHORS
@@ -236,6 +236,7 @@ answer newbie questions, and generally made Django that much better:
236 236
     Janos Guljas
237 237
     Thomas Güttler <hv@tbz-pariv.de>
238 238
     Horst Gutmann <zerok@zerokspot.com>
  239
+    Bouke Haarsma <bouke@haarsma.eu>
239 240
     Antti Haapala <antti@industrialwebandmagic.com>
240 241
     Scot Hacker <shacker@birdhouse.org>
241 242
     dAniel hAhler
8  docs/howto/custom-template-tags.txt
@@ -495,8 +495,12 @@ Notes:
495 495
 
496 496
 * The ``render()`` method is where the work actually happens.
497 497
 
498  
-* ``render()`` should never raise ``TemplateSyntaxError`` or any other
499  
-  exception. It should fail silently, just as template filters should.
  498
+* ``render()`` should generally fail silently, particularly in a production
  499
+  environment where :setting:`DEBUG` and :setting:`TEMPLATE_DEBUG` are
  500
+  ``False``. In some cases however, particularly if :setting:`TEMPLATE_DEBUG` is
  501
+  ``True``, this method may raise an exception to make debugging easier. For
  502
+  example, several core tags raise ``django.template.TemplateSyntaxError``
  503
+  if they receive the wrong number or type of arguments.
500 504
 
501 505
 Ultimately, this decoupling of compilation and rendering results in an
502 506
 efficient template system, because a template can render multiple contexts

0 notes on commit 7f62d79

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