gregsadetsky / minimalish-django-starter

Django + Vite starter kit & easy deployment using disco
0 stars 1 forks source link

add 'trick' to always show invalid template variables #4

Open gregsadetsky opened 10 months ago

gregsadetsky commented 10 months ago

i.e. the amazing trick of

https://stackoverflow.com/questions/4300442/show-undefined-variable-errors-in-django-templates#comment131874878_4300506

i.e. add

TEMPLATES[0]["OPTIONS"]["string_if_invalid"] = "MISSING! {{ %s }}"

in starter/settings/dev.py

gregsadetsky commented 10 months ago

.... using it a little bit across some other projects, I've found that it can be annoying and that the default "silently don't show anything for missing variables" behavior is actually a pretty good idea..... so closing this for now

gregsadetsky commented 2 months ago

I don't agree with myself here - it's actually incredibly helpful.......................