Skip to content

Commit

Permalink
Django 5x logout
Browse files Browse the repository at this point in the history
  • Loading branch information
amadev committed May 24, 2024
1 parent 19e481a commit 7c90f80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jet/templates/admin/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
<body class="{% if request.COOKIES.sidebar_pinned != 'false' %}menu-pinned {% endif %}{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
data-admin-utc-offset="{% now "Z" %}">

<form id="logout-form" method="post" action="{% url 'admin:logout' %}">
{% csrf_token %}
</form>

<!-- Container -->
<div id="container">

Expand Down Expand Up @@ -79,7 +83,7 @@
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
{% endif %}
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
<a href="#" onclick="document.getElementById('logout-form').submit();">{% trans 'Log out' %}</a>
{% endblock %}
</div>
{% endif %}
Expand Down

0 comments on commit 7c90f80

Please sign in to comment.