On Django versions < 1.11, the logout view allowed us to use a POST
request.
Because no ''post'' method is defined on the new ''LogoutView'' introduced
in
https://github.com/django/django/commit/78963495d0caadb77eb97ccf319ef0ba3b204fb5,
a POST request will raise 405 Method not allowed error. I don't think POST
was officially supported (don't see it in the docs) but there's code in
the view that checks for the redirect field in the POST data.
--
Ticket URL: <https://code.djangoproject.com/ticket/28513>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* component: Uncategorized => contrib.auth
* stage: Unreviewed => Accepted
* type: Uncategorized => Bug
* severity: Normal => Release blocker
Old description:
> Hello,
>
> On Django versions < 1.11, the logout view allowed us to use a POST
> request.
>
> Because no ''post'' method is defined on the new ''LogoutView''
> introduced in
> https://github.com/django/django/commit/78963495d0caadb77eb97ccf319ef0ba3b204fb5,
> a POST request will raise 405 Method not allowed error. I don't think
> POST was officially supported (don't see it in the docs) but there's code
> in the view that checks for the redirect field in the POST data.
New description:
The function-based `logout()` view allows using a POST request.
Because the new `LogoutView` introduced in
78963495d0caadb77eb97ccf319ef0ba3b204fb5 doesn't define a `post()` method,
a POST request returns "405 Method not allowed". I don't think POST was
officially supported (don't see it in the docs) but there's code in the
view that checks for the redirect field in the POST data.
--
Comment:
It seems reasonable to support that.
--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:1>
* owner: nobody => hui shang
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:2>
* has_patch: 0 => 1
Comment:
[ https://github.com/django/django/pull/8964#### PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:3>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c0f4c60edd429f5ef57241cfabd159d13e26e5ac" c0f4c60e]:
{{{
#!CommitTicketReference repository=""
revision="c0f4c60edd429f5ef57241cfabd159d13e26e5ac"
Fixed #28513 -- Added POST request support to LogoutView.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:5>
Comment (by Tim Graham <timograham@…>):
In [changeset:"58aaf13e759cf60f8eaab42f650921923fde6502" 58aaf13e]:
{{{
#!CommitTicketReference repository=""
revision="58aaf13e759cf60f8eaab42f650921923fde6502"
[1.11.x] Fixed #28513 -- Added POST request support to LogoutView.
Backport of c0f4c60edd429f5ef57241cfabd159d13e26e5ac from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28513#comment:6>