I wrote these for loop, but I got the Error : Django Invalid Block Tag: 'endfor'
{ % for post in post_list %}
<div>
{{ post.title }}
{{ post.created_at }}
{{ post.photo }}
{{ post.content }}
</div>
{% endfor %}
You're getting that error because there is a space between {
and %
where the for
tag begins.
Change this - { %
to look like this - {%
, i.e. remove the space between {
and %
:
{% for post in post_list %}
...
{% 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