Re: To keep or not to keep: logging of undefined template variables

2017-08-24 Thread Collin Anderson
I used to do that too (string_if_invalid that raises an exception). What was nice about this, is you could explicitly wrap the variable in an if tag to silence the error if you were ok with it. (I'm not sure if this behavior is still true.) {% if var_that_sometimes_exists %}{{ var_that_sometimes_e

Re: To keep or not to keep: logging of undefined template variables

2017-08-24 Thread Sjoerd Job Postmus
As an anecdotal data-point: at the company I'm working at, we are running Django with a custom object as "string_if_invalid" that raises an exception on string-interpolation. This way missing template variables *do* get converted to an exception. I myself am very happy with this solution, as it

Re: To keep or not to keep: logging of undefined template variables

2017-08-24 Thread Tim Graham
We received a report that shows the large number of undefined variable warnings when rendering an admin changelist page [0]. I'm still not sure what the solution should be, but I created #28526 [1] to track this problem: finding a remedy to the problem of verbose, often unhelpful logging of un