﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20962	Documentation on template tag render() methods is inconsistent with core tags.	Keryn Knight <django@…>	nobody	"According to the [https://docs.djangoproject.com/en/1.6/howto/custom-template-tags/#writing-the-renderer documentation]:

''render() should never raise TemplateSyntaxError or any other exception. It should fail silently, just as template filters should.''

As I write this, at a glance, [https://github.com/django/django/blob/ff410565bf1cf1a2905c1ef83db408d455211446/django/template/defaulttags.py#L419 URLNode.render()], [https://github.com/django/django/blob/ff410565bf1cf1a2905c1ef83db408d455211446/django/template/defaulttags.py#L475 WidthRatio.render()], both raise TemplateSyntaxError. So do some of those outside defaulttags, such as [https://github.com/django/django/blob/5080311998a8ecc5b3f9fa162c19e55b70aa9f85/django/templatetags/cache.py#L20 CacheNode.render()], and it looks like [https://github.com/django/django/blob/0073f1d94fad3f04ed77e63984cfd7827f78e580/django/template/loader_tags.py#L94 ExtendsNode.get_parent()] does too (ForLoopNode.render() does, but is exempted from this list because it explicitly only does so if TEMPLATE_DEBUG is True)

I'm marking this as a documentation issue, as I think the wording should be changed to reflect that ideally template tags should fail silently [at least in production, where DEBUG and TEMPLATE_DEBUG should be False], but it is understandable that sometimes they cannot, which is I assume why Django hasn't ""dogfooded"" it's own advice here.

The links above should all be to the files/documentation as they stand when writing this, pinned to 1.6 or the last commit for temporal accuracy going forwards."	Cleanup/optimization	closed	Documentation	dev	Normal	fixed	afraid-to-commit	Daniele Procida	Accepted	1	0	0	0	0	0
