title: Django: For Loop to Iterate Form Fields
body: <p>I don't want to use django's built in form generation, seeking to specify each field in my template in order to customize the html output. </p>
  
  <p>How do I iterate over a series of form fields?</p>
  
  <p>If my form looks like this:</p>
  
  <pre><code>class MyForm(forms.Form):
      main_image = forms.ImageField()
      second_image = forms.ImageField()
      third_image = forms.ImageField()
      fourth_image = forms.ImageField()
      ...
  </code></pre>
  
  <p>Is there way to write a <code>{% for %}</code> loop so that I can iterate through:</p>
  
  <pre><code>{{ form.main_image }}
  {{ form.second_image }}
  {{ form.third_image }}
  {{ form.fourth_image }}
  </code></pre>
  
  <p>I tried the following which seemed logical, but did not work:</p>
  
  <pre><code>{% for field in form %}
    {{ form.field }}
  {% endfor %}
  </code></pre>