login.html 970 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. {% extends "base.html" %}
  2. {% block content %}
  3. {% if form.errors %}
  4. <p>Your username and password didn't match. Please try again.</p>
  5. {% endif %}
  6. {% if next %}
  7. {% if user.is_authenticated %}
  8. <p>Your account doesn't have access to this page. To proceed,
  9. please login with an account that has access.</p>
  10. {% else %}
  11. <p>Please login to see this page.</p>
  12. {% endif %}
  13. {% endif %}
  14. <form method="post" action="{% url 'login' %}">
  15. {% csrf_token %}
  16. <table>
  17. <tr>
  18. <td>{{ form.username.label_tag }}</td>
  19. <td>{{ form.username }}</td>
  20. </tr>
  21. <tr>
  22. <td>{{ form.password.label_tag }}</td>
  23. <td>{{ form.password }}</td>
  24. </tr>
  25. </table>
  26. <input type="submit" value="login">
  27. <input type="hidden" name="next" value="{% if next %}{{ next }}{% else %}{% url 'interface:interface-list' %}{% endif %}">
  28. </form>
  29. {# Assumes you setup the password_reset view in your URLconf #}
  30. <p><a href="{% url 'password_reset' %}">Lost password?</a></p>
  31. {% endblock %}