[Answer]-Django Templates: no output in template if statment

1👍

I believe there’s a syntax error in your code that passed by unnoticed:

{% else % }

should be:

{% else %}

Django template system probably looks for a regex {%...%}, and as that didn’t match, it was regarded simply as text inside the {% if %}{% endif %} node.

Leave a comment