Created
March 9, 2011 20:39
-
-
Save jeffkistler/862959 to your computer and use it in GitHub Desktop.
A generic Django authentication form template.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Include this template from your site base template like so: | |
{% if user.is_anonymous %} | |
{% include "login_form.html" %} | |
{% endif %} | |
{% endcomment %} | |
{% load i18n %} | |
<form method="post" action="{% url django.contrib.auth.views.login %}"> | |
{{ auth_form.non_field_errors }} | |
<p> | |
{{ auth_form.username.errors }} | |
<label for="id_username">{% trans "Username" %}:</label> <input type="text" name="username" id="id_username"> | |
</p> | |
<p> | |
{{ auth_form.password.errors }} | |
<label for="id_password">{% trans "Password" %}:</label> <input type="text" name="password" id="id_password"> | |
</p> | |
<p> | |
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}"> | |
<input type="submit" value="{% trans "Log in" %}"> | |
<input type="hidden" name="next" value="{{ next }}"> | |
</p> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment