# Django-jazzmin - Logout

**URL:** <https://forum.djangoproject.com/t/django-jazzmin-logout/26110>\
**Category:** Mystery Errors\
**Created:** [December 13, 2023, 1:05am UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110 "2023-12-13T01:05:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Consumid0r](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/consumid0r/32/17415_2.png) [@Consumid0r](https://forum.djangoproject.com/u/Consumid0r)\
**Post date:** [December 13, 2023, 1:05am UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/1 "2023-12-13T01:05:19Z")

</div>

I’ve installed Django Jazzmin by following the instructions provided at [Installation - Jazzmin](https://django-jazzmin.readthedocs.io/installation/). However, I’m encountering an issue when accessing my admin panel. I can log in successfully, but upon logging out, I encounter the following error:

```auto
[13/Dec/2023 01:46:18] "GET /admin/logout/ HTTP/1.1" 405 0

```

I’ve learned from the forum that using GET to log out from Django is deprecated. I’m currently using Django 5.0, and I attempted to resolve the issue by uninstalling Jazzmin. After doing so, I can log out successfully, and the following message is displayed:

```auto
[13/Dec/2023 01:55:46] "POST /admin/logout/ HTTP/1.1" 200 3553

```

However, I would like to continue using Django Jazzmin. Unfortunately, the error persists when I reinstall it, and I’m unsure how to address it. I suspect it might be a misconfiguration in Django Jazzmin. Any ideas or suggestions would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [December 13, 2023, 1:22am UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/2 "2023-12-13T01:22:24Z")

</div>

The details at [django-jazzmin · PyPI](https://pypi.org/project/django-jazzmin/) show that it’s only tested up through Django 3.1, and hasn’t published an update in more than a year.

If you want to use it with a more current version, you’ll either need to find a fork of it that has been upgraded, or fork and upgrade it yourself.

---

<div class="post-metadata">

**Author:** ![Consumid0r](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/consumid0r/32/17415_2.png) [@Consumid0r](https://forum.djangoproject.com/u/Consumid0r)\
**Post date:** [December 13, 2023, 1:25am UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/3 "2023-12-13T01:25:20Z")

</div>

Wow i missed that. Thanks a lot Ken.

---

<div class="post-metadata">

**Author:** ![geminixiang](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/geminixiang/32/17823_2.png) [@geminixiang](https://forum.djangoproject.com/u/geminixiang)\
**Post date:** [December 16, 2023, 2:15pm UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/4 "2023-12-16T14:15:07Z")

</div>

I encountered the same issue and improved the problem encountered with GET logout through the following method.

> <https://github.com/farridav/django-jazzmin/blob/586e81f204033add57b67f657e43681801356a9a/jazzmin/templates/admin/base.html#L163-L165>

modify it

```html
<!-- Django 4.1 only supports POST for logout. -->
<form action="{% url 'admin:logout' %}" method="post">
    {% csrf_token %}
    <button type="submit" class="dropdown-item">
        <i class="fas fa-users mr-2"></i> {% trans 'Log out' %}
    </button>
</form>

```

---

<div class="post-metadata">

**Author:** ![idan-krayon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/idan-krayon/32/17980_2.png) [@idan-krayon](https://forum.djangoproject.com/u/idan-krayon)\
**Post date:** [December 26, 2023, 2:44pm UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/5 "2023-12-26T14:44:00Z")

</div>

I can confirm that @geminixiang fix is working. can you please make the change in the base code?  
@KenWhitesell FYI. we are working on django 5.X and Jazzmin working fine for us.

---

<div class="post-metadata">

**Author:** ![HamaBarhamou](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/hamabarhamou/32/18007_2.png) [@HamaBarhamou](https://forum.djangoproject.com/u/HamaBarhamou)\
**Post date:** [December 26, 2023, 8:22pm UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/6 "2023-12-26T20:22:43Z")

</div>

@idan-krayon I think it’s up to all django eco-system applications to adapt to django, not the other way around.  
You can defend the question [here](https://github.com/farridav/django-jazzmin/issues/524)

---

<div class="post-metadata">

**Author:** ![Earnstein](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/earnstein/32/18559_2.png) [@Earnstein](https://forum.djangoproject.com/u/Earnstein)\
**Post date:** [January 19, 2024, 8:47pm UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/7 "2024-01-19T20:47:01Z")

</div>

Massive thanks! , I’ve been wrestling with this issue for over an hour, and your solution helped me successfully navigate around it.

Plus, the solution is quite straightforward, however, I’m curious why the base code hasn’t been updated. Do you foresee any potential issues for users on Django 4.x if this remains unchanged?

---

<div class="post-metadata">

**Author:** ![bornbrainy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/bornbrainy/32/18577_2.png) [@bornbrainy](https://forum.djangoproject.com/u/bornbrainy)\
**Post date:** [January 21, 2024, 7:57am UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/8 "2024-01-21T07:57:58Z")

</div>

how can i access it, i am using virtual env

---

<div class="post-metadata">

**Author:** ![MohamedReda2003](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mohamedreda2003/32/19132_2.png) [@MohamedReda2003](https://forum.djangoproject.com/u/MohamedReda2003)\
**Post date:** [February 13, 2024, 9:25am UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/9 "2024-02-13T09:25:25Z")

</div>

you can access it in the following path : your\_virtual\_env\Lib\site-packages\jazzmin\templates\admin

---

<div class="post-metadata">

**Author:** ![MohamedReda2003](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/mohamedreda2003/32/19132_2.png) [@MohamedReda2003](https://forum.djangoproject.com/u/MohamedReda2003)\
**Post date:** [February 13, 2024, 9:48am UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/10 "2024-02-13T09:48:49Z")

</div>

I have Django 5.0, and even after replacing this element, I am still encountering the same issue (error 405). What should I do in this case?

---

<div class="post-metadata">

**Author:** ![shokuyansh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/shokuyansh/32/19816_2.png) [@shokuyansh](https://forum.djangoproject.com/u/shokuyansh)\
**Post date:** [March 11, 2024, 8:33pm UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/11 "2024-03-11T20:33:54Z")

</div>

what about views ? since it is basically just template, i need the user to be actually logged out?

---

<div class="post-metadata">

**Author:** ![wellerrrr](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wellerrrr/32/20565_2.png) [@wellerrrr](https://forum.djangoproject.com/u/wellerrrr)\
**Post date:** [April 11, 2024, 6:58pm UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/12 "2024-04-11T18:58:47Z")

</div>

did u solve that issue?

---

<div class="post-metadata">

**Author:** ![HamaBarhamou](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/hamabarhamou/32/18007_2.png) [@HamaBarhamou](https://forum.djangoproject.com/u/HamaBarhamou)\
**Post date:** [April 19, 2024, 9:45am UTC](https://forum.djangoproject.com/t/django-jazzmin-logout/26110/13 "2024-04-19T09:45:24Z")

</div>

this problem has been definitively solved and merged [here](https://github.com/farridav/django-jazzmin/issues/524)
