[Django] #35063: Django 5 LOGOUT_REDIRECT_URL does not work correctly

49 views
Skip to first unread message

Django

unread,
Dec 27, 2023, 11:21:58 AM12/27/23
to django-...@googlegroups.com
#35063: Django 5 LOGOUT_REDIRECT_URL does not work correctly
-----------------------------------------+------------------------
Reporter: Koljasha | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Procedure, explanation:
* create default project 'root': `django-admin startproject root`
* do migrate: `python manage.py migrate`
* createsuperuser: `python manage.py createsuperuser`
* add in `root/settings.py` for example: `LOGOUT_REDIRECT_URL =
'admin:index'`
* add in `root/urls.py`: `path('accounts/',
include('django.contrib.auth.urls')),`
* after authorization, I do: http://127.0.0.1:8000/accounts/logout/
- in 4.2.8 correct - redirect:
http://127.0.0.1:8000/admin/login/?next=/admin/
- in 5.0 not correct - only white screen and in console: "GET
/accounts/logout/ HTTP/1.1" 405 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35063>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 27, 2023, 11:30:44 AM12/27/23
to django-...@googlegroups.com
#35063: Django 5 LOGOUT_REDIRECT_URL does not work correctly
------------------------------+--------------------------------------
Reporter: Koljasha | Owner: nobody
Type: Bug | Status: closed
Component: contrib.auth | Version: 5.0
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => invalid
* component: Uncategorized => contrib.auth
* type: Uncategorized => Bug


Comment:

As per the Django 5.0 release notes, support for logging out via GET
requests in the `django.contrib.auth.views.LogoutView` is removed. You
must issue a `POST` in order to log out and be redirected.

--
Ticket URL: <https://code.djangoproject.com/ticket/35063#comment:1>

Reply all
Reply to author
Forward
0 new messages