django template change behaviour to silent_variable_failure = False

django, django-templates

Solution

In settings.py I added TEMPLATE_STRING_IF_INVALID = "invalid string '%s'" See http://docs.djangoproject.com/en/dev/ref/templates/api/#invalid-template-variables for more info.

It includes this warning "Many templates, including those in the Admin site, rely upon the silence of the template system when a non-existent variable is encountered. If you assign a value other than '' to TEMPLATE_STRING_IF_INVALID, you will experience rendering problems with these templates and sites."

Problem

http://www.djangobook.com/en/beta/chapter10/ "Note that django.core.exceptions.ObjectDoesNotExist, which is the base class for all Django database API DoesNotExist exceptions, has silent_variable_failure = True. So if you’re using Django templates with Django model objects, any DoesNotExist exception will fail silently." Whilst I'm developing I'd like to reverse this behaviour, i.e. silent_variable_failure = False. How do I make this change permanent whilst developing under django ? Thanks, Nick

Original source

Related problems