title: How to style a django form - bootstrap
body: <p>I am styling my django app but Iam having trouble styling the forms. I have a contact form, in my forms.py and then I have use it in a template.</p>
  
  <pre><code>&lt;form class="form-contact" action="" method="POST"&gt;
  {% csrf_token %} 
  &lt;input type="text" name="Name" id="id_name" value="{{form.name}}" /&gt;
  &lt;input type="submit" value="Submit"  class="btn btn-primary"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>That isn't working. I have also tried this, but still no luck, it shows styled fields but doesn't retrieve the information ( I get a message under my {{form.errors}} .</p>
  
  <pre><code>&lt;form class="form-contact" action="" method="POST"&gt;
  {% csrf_token %} 
  {% for field in form %}
  &lt;fieldset class="form-group"&gt;
      &lt;label class="control-label" for="id_{{ field.name }}"&gt;{{ field.label }}&lt;/label&gt;
           &lt;div class="form-control"&gt;
          &lt;input type="text" class="form-control"
              name="{{ field.label }}"
              id="{{ field.name }}"
              value="{{ field.name }}" &gt;
           {{ field }} 
          &lt;p class="help-text"&gt;{{ field.help_text }} &lt;/p&gt;
         &lt;/div&gt;
  &lt;/fieldset&gt;
  {% endfor %}
     &lt;input type="submit" value="Submit"  class="btn btn-primary"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Any hint would be apreciated.
  Regards.</p>
  
  <p>EDIT:
  This second code, is actually showing 2 input fields for each form field. If I fill the second one, the form works but, this second input has no styling...</p>