title: Get field type in Django's login template
body: <p>I'm trying to create custom template for Django's build-in login view. At the moment it looks like (<code>registration/login.html</code>):</p>
  
  <pre><code>&lt;form method="post"&gt;
      {% csrf_token %}
  
      {% for field in form %}
          {% include 'registration/form_field.html' %}
      {% endfor %}
  
      &lt;input class="btn btn-primary btn-block" type="submit" value="{% trans "Log in" %}"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And <code>registration/form_field.html</code> file is:</p>
  
  <pre><code>&lt;div class="form-group {% if field.errors %}has-error{% endif %}"&gt;
      &lt;input class="form-control" name="{{ field.name }}" placeholder="{{ field.label }}" {% if field.data %}value="{{ field.data }}"{% endif %} /&gt;
      {% if field.errors %}
          &lt;span class='text-danger'&gt;{{ field.errors|join:'&lt;br&gt;' }}&lt;/span&gt;
      {% endif %}
  &lt;/div&gt;
  </code></pre>
  
  <p>Everything works as expected, only problem is that password is shown in clear text.</p>
  
  <p>To solve this <code>type="password"</code> should be set for <code>password</code> field (and <code>type="text"</code> for <code>username</code> field).</p>
  
  <p>Is it possible to implement this using <code>field</code> variable (i.e. something like <code>{{ field.type }}</code>)?</p>