{% load form_helpers %} {% load i18n %} {% if form.fieldsets %} {# Render hidden fields #} {% for field in form.hidden_fields %} {{ field }} {% endfor %} {# Render grouped fields according to Form #} {% for fieldset in form.fieldsets %} {% render_fieldset form fieldset %} {% endfor %} {% if form.custom_fields %}
{% trans "Custom Fields" %}
{% render_custom_fields form %}
{% endif %} {% if form.comments %}
{% render_field form.comments %}
{% endif %} {% else %} {# Render all fields in a single group #}
{% render_form form %}
{% endif %}