{% block form_body %} {{ form.non_field_errors }} {# Hack to allow recursive template inclusion #} {% with fieldset_template_name="partials/fieldset_as_div.html" field_template_name="partials/field_as_div.html" %} {% block form_head %} {% if not no_head %} {% csrf_token %} {% if next %}{% endif %} {% endif %} {% endblock %} {% for thing in form %} {% if thing.is_fieldset %}
{% include fieldset_template_name with fieldset=thing %}
{% else %} {% include field_template_name with field=thing %} {% endif %} {% endfor %} {% endwith %} {% endblock %}