{% if not no_token %} {% csrf_token %} {% endif %} {% if form.non_field_errors %} {{ form.non_field_errors }} {% endif %}
{% if legend %} {{ legend }} {% endif %} {% for field in form.visible_fields %} {% include '_form_field.html' with field=field %} {% endfor %} {% if formset %} {{ formset.management_form }} {% endif %} {% for formset_form in formset %} {{ formset_legend }} {% if formset_add %} {{ forloop.counter|add:formset_add }}: {% else %} {{ forloop.counter }}: {% endif %} {% for field in formset_form.visible_fields %} {% include '_form_field.html' with field=field %} {% endfor %} {% for hidden in formset_form.hidden_fields %} {{ hidden }} {% endfor %} {% endfor %}

{% for hidden in form.hidden_fields %} {{ hidden }} {% endfor %} {% if next %} {% endif %}