django-project/templates/registration/login.html

39 lines
801 B
HTML

{% extends "base.html" %}
{% block body %}
{% if form.errors %}
<section>
<p>Username and password do not match. Please try again.</p>
</section>
{% endif %}
{% if next %}
<section>
{% if user.is_authenticated %}
<p>You are not authorized to access this site. Please log in with an account with the necessary permissions.</p>
{% else %}
<p>Please log in to view this site.</p>
{% endif %}
</section>
{% endif %}
<form action="{% url 'login' %}" method="post">
{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag }}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{{ form.password.label_tag }}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<input type="submit" value="Login">
<input type="hidden" name="next" value="{{ next }}">
</form>
{% endblock %}