I made a template for my Django project but I’m getting a syntax error that I don’t know where it comes
Here is the error:
Invalid block tag on line 14: ‘endfor’, expected ‘endblock’. Did you forget to register or load this tag?
And here is my template code:
{% extends "base.html" %} {% block page_content %}
<div class="col-md-8 offset-md-2">
<h1>Blog Index</h1>
<hr />
{% for post in posts %}
<h2><a href="{% url 'blog_detail' post.pk%}">{{ post.title }}</a></h2>
<small>
{{ post.created_on.date }} | Categories: {% for category in
post.categories.all %}
<a href="{% url 'blog_category' category.name %}"> {{ category.name }} </a
> {% endfor %}
</small>
<p>{{ post.body | slice:":400" }}...</p>
{% endfor %}
</div>
{% endblock %}