title: How to customize the input element generated by django.forms?
body: <p>I'm using django.forms to generate my login/signup page, part of code is as follows:</p>
  
  <pre><code>&lt;form method="post" action="{% url 'login' %}"&gt;
  {% csrf_token %}
  &lt;table&gt;
  &lt;tr&gt;
      {# username is directed to email field in our model #}
      &lt;td&gt;{{ form.username.label_tag }}&lt;/td&gt;
      &lt;td&gt;{{ form.username }}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;{{ form.password.label_tag }}&lt;/td&gt;
      &lt;td&gt;{{ form.password }}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;input type="submit" value="login" /&gt;
  {% if next %}
      &lt;input type="hidden" name="next" value="{{ next }}" /&gt;
  {% else %}
      &lt;input type="hidden" name="next" value="{% url 'home' %}" /&gt;
  {% endif %}
  &lt;/form&gt;
  </code></pre>
  
  <p>As you can see, the <code>{{ form.username }}</code> and <code>{{ form.password }}</code> will automatically generate an <code>&lt;input id="id_username" maxlength="254" name="username" type="text"&gt;</code> and an <code>&lt;input id="id_password" name="password" type="password"&gt;</code> respectively. But I want to add some extra attributes to these <code>input</code> fields, like <code>placeholder</code>and <code>class</code>. Where can I customize these?</p>