[Django] #35043: LogoutView.as_view() no longer works in 5.0

67 views
Skip to first unread message

Django

unread,
Dec 15, 2023, 9:18:34 PM12/15/23
to django-...@googlegroups.com
#35043: LogoutView.as_view() no longer works in 5.0
-------------------------------------------+------------------------
Reporter: otonoton | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: 5.0
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
I'm having the same issue as #35013. I have in my urls.py:
{{{
path('logout/', auth_views.LogoutView.as_view()),
}}}
but since GET support was removed for LogoutView, this no longer works. Is
this a regression, or what is the correct way to handle this?

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

Django

unread,
Dec 16, 2023, 3:32:56 AM12/16/23
to django-...@googlegroups.com
#35043: LogoutView.as_view() no longer works in 5.0
---------------------------------+--------------------------------------
Reporter: otonoton | Owner: nobody
Type: Bug | Status: closed

Component: HTTP handling | Version: 5.0
Severity: Release blocker | Resolution: duplicate

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 Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #35013.

Please don't open duplicates and check
[https://docs.djangoproject.com/en/stable/releases/4.1/#log-out-via-get
release notes].

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

Django

unread,
Dec 17, 2023, 2:19:39 PM12/17/23
to django-...@googlegroups.com
#35043: LogoutView.as_view() no longer works in 5.0
---------------------------------+--------------------------------------
Reporter: otonoton | Owner: nobody
Type: Bug | Status: closed
Component: HTTP handling | Version: 5.0
Severity: Release blocker | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by otonoton):

I don't consider it a duplicate because URL path entries do not specify a
request method. Please don't just immediately close my ticket without at
least attempting to communicate with me first.

--
Ticket URL: <https://code.djangoproject.com/ticket/35043#comment:2>

Django

unread,
Dec 17, 2023, 4:05:40 PM12/17/23
to django-...@googlegroups.com
#35043: LogoutView.as_view() no longer works in 5.0
---------------------------------+--------------------------------------
Reporter: otonoton | Owner: nobody
Type: Bug | Status: closed
Component: HTTP handling | Version: 5.0
Severity: Release blocker | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by Mariusz Felisiak):

> Please don't just immediately close my ticket without at least
attempting to communicate with me first.

Then provide any details and follow our
[https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-
features/#reporting-bugs bug reporting guidelines]. I don't think you've
explained the issue in enough detail to confirm a bug in Django.

> I don't consider it a duplicate because URL path entries do not specify
a request method.

What do you mean? How could we understand what you're trying to report?
The ticket description shows that it's a duplicate. `LogoutView`
implements `post()` and release notes describe precisely that you should
use `POST` requests.

--
Ticket URL: <https://code.djangoproject.com/ticket/35043#comment:3>

Django

unread,
Dec 17, 2023, 6:00:49 PM12/17/23
to django-...@googlegroups.com
#35043: LogoutView.as_view() no longer works in 5.0
---------------------------------+--------------------------------------
Reporter: otonoton | Owner: nobody
Type: Bug | Status: closed
Component: HTTP handling | Version: 5.0
Severity: Release blocker | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by otonoton):

How am I supposed to use LogoutView in urls.py now? i.e. without any other
explicit view or template being defined (just like how it used to work)

--
Ticket URL: <https://code.djangoproject.com/ticket/35043#comment:4>

Django

unread,
Dec 17, 2023, 10:02:07 PM12/17/23
to django-...@googlegroups.com
#35043: LogoutView.as_view() no longer works in 5.0
---------------------------------+--------------------------------------
Reporter: otonoton | Owner: nobody
Type: Bug | Status: closed
Component: HTTP handling | Version: 5.0
Severity: Release blocker | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by Tim Graham):

If you would like to continue supporting logout via GET, you could copy
`LogoutView` from Django 4.2 and use that in your project.

--
Ticket URL: <https://code.djangoproject.com/ticket/35043#comment:5>

Reply all
Reply to author
Forward
0 new messages