Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #20962 -- Documented that template tag render() may raise excep…

…tions.

Thanks Keryn Knight for the report.
  • Loading branch information...
commit e077224f4ad69a68ae58a373ef69941272d3656c 1 parent 54cd930
Bouke Haarsma authored October 14, 2013 timgraham committed October 14, 2013
1  AUTHORS
@@ -277,6 +277,7 @@ answer newbie questions, and generally made Django that much better:
277 277
     Janos Guljas
278 278
     Thomas Güttler <hv@tbz-pariv.de>
279 279
     Horst Gutmann <zerok@zerokspot.com>
  280
+    Bouke Haarsma <bouke@haarsma.eu>
280 281
     Antti Haapala <antti@industrialwebandmagic.com>
281 282
     Scot Hacker <shacker@birdhouse.org>
282 283
     dAniel hAhler
8  docs/howto/custom-template-tags.txt
@@ -478,8 +478,12 @@ Notes:
478 478
 
479 479
 * The ``render()`` method is where the work actually happens.
480 480
 
481  
-* ``render()`` should never raise ``TemplateSyntaxError`` or any other
482  
-  exception. It should fail silently, just as template filters should.
  481
+* ``render()`` should generally fail silently, particularly in a production
  482
+  environment where :setting:`DEBUG` and :setting:`TEMPLATE_DEBUG` are
  483
+  ``False``. In some cases however, particularly if :setting:`TEMPLATE_DEBUG` is
  484
+  ``True``, this method may raise an exception to make debugging easier. For
  485
+  example, several core tags raise ``django.template.TemplateSyntaxError``
  486
+  if they receive the wrong number or type of arguments.
483 487
 
484 488
 Ultimately, this decoupling of compilation and rendering results in an
485 489
 efficient template system, because a template can render multiple contexts

0 notes on commit e077224

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