Opened 7 weeks ago

Closed 23 hours ago

#35784 closed New feature (fixed)

Add 307 and 308 redirect response codes to django.shortcuts.redirect

Reported by: Lorenzo Peña Owned by: Lorenzo Peña
Component: HTTP handling Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Other than 301 and 302 response codes for redirects, there is also:

Currently, Django is unaware of these.

Proposal:

  • Add two new HTTP response classes for 307 and 308.
  • Enhance django.shortcuts.redirect with a new keyword argument preserve_method that, in combination with the existing permanent, decides which of the four redirect classes to use.

Change History (13)

comment:1 by Lorenzo Peña, 7 weeks ago

Owner: set to Lorenzo Peña
Status: newassigned

comment:2 by Lorenzo Peña, 7 weeks ago

Has patch: set

https://github.com/django/django/pull/18616

Proof of concept until the ticket itself is approved. After that tests and documentation will be updated.

comment:3 by Sarah Boyce, 7 weeks ago

Component: UncategorizedHTTP handling
Summary: Enhance django.shortcuts.redirect with two new types of redirect response codesAdd 307 and 308 redirect response codes to django.shortcuts.redirect
Triage Stage: UnreviewedAccepted
Type: UncategorizedNew feature

Refs #30582 and the old django developer discussion
Agree that the way forward is to add new classes

comment:4 by ontowhee, 7 weeks ago

Patch needs improvement: set

comment:5 by Lorenzo Peña, 6 weeks ago

Patch needs improvement: unset

comment:6 by Natalia Bidart, 6 weeks ago

Needs documentation: set
Needs tests: set
Patch needs improvement: set

comment:7 by Lorenzo Peña, 6 weeks ago

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:8 by Sarah Boyce, 4 weeks ago

Patch needs improvement: set

comment:9 by Lorenzo Peña, 13 days ago

Patch needs improvement: unset

comment:10 by Sarah Boyce, 11 days ago

Triage Stage: AcceptedReady for checkin

comment:11 by Sarah Boyce, 9 days ago

Triage Stage: Ready for checkinAccepted

comment:12 by Natalia Bidart, 23 hours ago

Triage Stage: AcceptedReady for checkin

comment:13 by GitHub <noreply@…>, 23 hours ago

Resolution: fixed
Status: assignedclosed

In 91c879e:

Fixed #35784 -- Added support for preserving the HTTP request method in HttpResponseRedirectBase.

Co-authored-by: Natalia <124304+nessita@…>

Note: See TracTickets for help on using tickets.
Back to Top