Django: logging template errors
问题 When I make an error in a django template {{placeholder}} , I get no error, just blank space in the output where I was expecting content. Is there a way to see something in my logs when this occurs, preferably using logging.warning or logging.error ? 回答1: The only thing Django provides for handling unknown context variables in TEMPLATE_STRING_IF_INVALID. You're going to have to do some deeper hacking of the template engine if you want better than that. 回答2: Yes, there is. Just add in your