Django: For Loop to Iterate Form Fields
The best way is to use two loops, one for hidden fields and one for visible fields :
visibles:
{% for field in form.visible_fields %} {{ field.label }} {{ field }}{% endfor %}
hiddens:
{% for hidden in form.hidden_fields %} {{ hidden }}{% endfor %}
in this way you will have better control over UI elements.