Messed up columns in Django Admin

16 October 2009   1 comment   Django

Mind That Age!

This blog post is 9 years old! Most likely, its content is outdated. Especially if it's technical.

In case this bites someone else like it bit more and chewed off many many minutes of debugging time.

If you ever get weird columns in your Django Administration interface, I now know why that happens. See this screenshot example:

Messed up columns in Django Admin

This happens when you've defined a TEMPLATE_STRING_IF_INVALID in your settings.py. I always put in my local_settings.py this line:

TEMPLATE_STRING_IF_INVALID = '{{ %s }}'

So that I can quickly see which variable references in template code is potential typos. I'm not a big fan of the implicit magic of equating absence to False/None so I try to avoid the confusion altogether.

Comments

Michael
Thanks a lot, Peter.
This saves me hours of looking for the mistake ;)

Regards from Hamburg, Germany
Michael

Your email will never ever be published


Related posts

Previous:
Automatically strip whitespace in Django forms 12 October 2009
Next:
What I hate about PIL and Image in Python 19 October 2009
Related by Keyword:
Javascript tip: nifty use of the console.log function in Firebug 07 November 2010
Review: Django 1.1 Testing and Debugging 20 May 2010
ReCSS a tool to reload the CSS without reloading the whole page 31 January 2006
Related by Text:
jQuery and Highslide JS 08 January 2008
I'm back! Peterbe.com has been renewed 05 June 2005
Anti-McCain propaganda videos 12 August 2008
Ever wondered how much $87 Billion is? 04 November 2003
Guake, not Yakuake or Yeahconsole 23 January 2010