title: Django - Override admin site's login form
body: <p>I'm currently trying to override the default form used in Django 1.4 when logging in to the admin site (my site uses an additional 'token' field required for users who opt in to Two Factor Authentication, and is mandatory for site staff). Django's default form does not support what I need. Currently, I've got a file in my <code>templates/</code> directory called <code>templates/admin/login.html</code>, which seems to be correctly overriding the template used with the one I use throughout the rest of my site. The contents of the file are simply as below:</p>
  
  <pre><code># admin/login.html:
  {% extends "login.html" %}
  </code></pre>
  
  <p>The actual login form is as below:</p>
  
  <pre><code># login.html:
  {% load url from future %}&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Please log in&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="loginform"&gt;
              &lt;form method="post" action="{% url 'id.views.auth' %}"&gt;
                  {% csrf_token %}
                  &lt;input type="hidden" name="next" value="{{ next }}" /&gt;
                  {{ form.username.label_tag }}&lt;br/&gt;
                  {{ form.username }}&lt;br/&gt;
                  {{ form.password.label_tag }}&lt;br/&gt;
                  {{ form.password }}&lt;br/&gt;
                  {{ form.token.label_tag }}&lt;br/&gt;
                  {{ form.token }}&lt;br/&gt;
                  &lt;input type="submit" value="Log In" /&gt;
             &lt;/form&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My issue is that the form provided works perfectly fine when accessed using my normal login URLs because I supply my own <code>AuthenticationForm</code> as the form to display, but through the Django Admin login route, Django likes to supply it's own form to this template and thus only the <code>username</code> and <code>password</code> fields render. Is there any way I can make this work, or is this something I am just better off 'hard coding' the HTML fields into the form for?</p>