Unclosed for tag in django. Looking for one of: empty, endfor

The error references {% for film in form %} not being closed in: form-template.html:

{% for field in form %}

{{field.errors}}

<label>{{ field.label_tag }}</label>
{{ field }}

{$ endfor %}

enter image description here

My comment_form.html:

<form action="" method="post">
    {$ csrf_token %}
    {% include 'films/form-template.html' %}
    <button type="submit">Submit</button>
</form>

urls.py:

app_name = 'films'

urlpatterns = [
    path('', views.IndexView.as_view(), name='index'),
    # path('<int:film_id>/comment', views.add_comment, name='add_comment'),
    path('<int:pk>', views.DetailView.as_view(), name='detail'),
    path('<int:film_id>/add/$', views.CommentCreate.as_view(), name='add_comment'),
]

Solution 1:

You have an error in the end tag of your for loop.

{$ endfor %}

Should be

{% endfor %}