«

»

Aug
29

Bad Error Message is Unhelpful

So, I’m still learning Django and have a long ways to go, but the following error is extremely unhelpful:

“TemplateSyntaxError: Invalid block tag: ‘else’, expected ‘else’ or ‘endif’”

The problem is, Django doesn’t do else if, but my editor does highlight it as if it’s correct. You then get this error message, but have to run through the docs to figure out that they want you to nest if/else blocks to create “else if.” Slightly frustrating, and causes me to write some questionably ugly code. Blegh.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>