Answer the question
In order to leave comments, you need to log in
How to make Django templates not swallow errors?
The settings are TEMPLATE_DEBUG.
But I found that it throws an exception in one method, and the templates swallow it - it debugged for a long time until I called it in the code.
Well, in general, so that he would not hush up None values.
Answer the question
In order to leave comments, you need to log in
As far as I remember, the TEMPLATE_STRING_IF_INVALID setting is responsible for this . Define it as '%s'
# settings.py
class InvalidVarException(object):
def __mod__(self, missing):
try:
missing_str=unicode(missing)
except:
missing_str='Failed to create string representation'
raise Exception('Unknown template variable %r %s' % (missing, missing_str))
def __contains__(self, search):
if search=='%s':
return True
return False
TEMPLATE_DEBUG=True
TEMPLATE_STRING_IF_INVALID = InvalidVarException()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question