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 18155,"Undocumented changes, indecision, in template fail silently exception handling",Aryeh Leib Taurog ,nobody,"I realize many tickets have already been opened regarding the fail silently feature of exception handling in templates, both for and against. I sense that django leadership has yet to express an unequivocal opinion on the matter, which is unfortunate. I hope my observations will be appreciated here: We all understand the need to facilitate debugging, but that shouldn't come at the expense of breaking production systems. On several occasions I have had users on my production site get server errors because of a backwards-incompatible change in the template fail silently feature between 1.2.7 and 1.3.1, of which I was not aware when I rolled out the update. It is almost impossible to identify now-broken templates a-priory and change them, so I expect more in the foreseeable future. The rules for predicting when template rendering can raise an exception and when not should be IMO simple or at least intuitive and well documented. I have searched through the documentation and I have not found any reference to changes in the fail silently feature. I personally would like to see fail silently reinstated completely for template rendering with DEBUG=TEMPLATE_DEBUG=False, for reasons stated above. If no explicit decision was made, than this is a functional bug. If the change was an intentional one, then this is a documentation bug; it should be documented very clearly. I'm attaching the stand-alone test script which demonstrates the difference in behavior between the django versions. Below is the output from the script. Oddly, the DEBUG and TEMPLATE_DEBUG settings have very little effect. {{{ Django version: 1.4 settings: {'DEBUG': False, 'TEMPLATE_DEBUG': False} ('{{ o.no_exception }}', u'Method') Caught exception: AttributeError() Django version: 1.4 settings: {'DEBUG': True, 'TEMPLATE_DEBUG': True} ('{{ o.no_exception }}', u'Method') Caught exception: AttributeError() Django version: 1.3 settings: {'DEBUG': False, 'TEMPLATE_DEBUG': False} ('{{ o.no_exception }}', u'Method') Caught exception: AttributeError() Django version: 1.3 settings: {'DEBUG': True, 'TEMPLATE_DEBUG': True} ('{{ o.no_exception }}', u'Method') Caught exception: TemplateSyntaxError(u'Caught AttributeError while rendering: ',) Django version: 1.2.7 settings: {'DEBUG': False, 'TEMPLATE_DEBUG': False} ('{{ o.no_exception }}', u'Method') ('{{ o.exception }}', u'') Django version: 1.2.7 settings: {'DEBUG': True, 'TEMPLATE_DEBUG': True} ('{{ o.no_exception }}', u'Method') ('{{ o.exception }}', u'') }}} ",Bug,closed,Template system,1.4,Normal,invalid,template fail silently,vim@…,Design decision needed,0,0,0,0,0,0