Use POST for logout, as GET is deprecated as of Django 4.1
This commit is contained in:
parent
1127978e10
commit
928886eb4e
@ -34,7 +34,10 @@
|
|||||||
href="{% block admin_link %}{% url 'admin:index' %}{% endblock %}">Admin</a>
|
href="{% block admin_link %}{% url 'admin:index' %}{% endblock %}">Admin</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<a class="nav-item nav-link" href="{% url 'logout' %}">Logout: {{ user }}</a>
|
<form method="post" action="{% url 'logout' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button class="btn" type="submit">Logout: {{ user }}</button>
|
||||||
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="nav-item nav-link"
|
<a class="nav-item nav-link"
|
||||||
href="{% url 'login' %}?next={{ request.get_full_path }}">Login</a>
|
href="{% url 'login' %}?next={{ request.get_full_path }}">Login</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user