{% extends 'base.html' %} {% block content %}

This is the home page

Here we have have several things.

{% for field, message in context_form.errors.items() %} {% endfor %}

Select the working context

{{ context_form.hidden_tag() }}
{% if context_form.context.errors %} {{ context_form.context(class="form-select is-invalid") }}
{% for error in context_form.context.errors %} {{ error }} {% endfor %}
{% else %} {{ context_form.context(class="form-select") }} {% endif %} {{ context_form.submit(class='btn btn-primary') }}
{% endblock %}