What could be the cause of the this TemplateSyntaxError
in Django?
Invalid block tag: 'endfor', expected 'endblock'
My template is pretty simple so far:
{% extends 'base.html' %}
{% block content %}
<div id='beerslist'>
{$ for beer in beers %}
{{ beer }}
{% endfor %}
</div>
{% endblock %}
After looking at the traceback list, the 'beer' variable exists and is returning an array. How can I fix this syntax error?
{$ for beer in beers %}
You typed a $
instead of %
. That's why it doesn't recognize the for
and complains that there's no for
block for it to close when it sees the endfor
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With