summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorVAIBHAVPANT07 <vaibhavpant24@gmail.com>2026-04-25 00:15:19 +0530
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2026-05-15 08:45:37 +0100
commitda6567da7ea0e844c9a880e02c7b34e1a184edf8 (patch)
treea37398df06458a26a0ae4e86d6323aac13cd9020 /docs
parent3dcbb80c3f916cddeaa1c0d33e07f06cc328f64a (diff)
Fixed #37062 -- Added preserve_request support to RedirectView.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/class-based-views/base.txt9
-rw-r--r--docs/releases/6.1.txt4
2 files changed, 12 insertions, 1 deletions
diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt
index 887a83b37f..2d745b5e98 100644
--- a/docs/ref/class-based-views/base.txt
+++ b/docs/ref/class-based-views/base.txt
@@ -277,6 +277,15 @@ ancestor classes are documented under the section title of **Ancestors
then the query string is discarded. By default, ``query_string`` is
``False``.
+ .. attribute:: preserve_request
+
+ .. versionadded:: 6.1
+
+ Whether to preserve the HTTP method and body during the redirect. If
+ ``True``, then the redirect will use status code 307 instead of 302,
+ or 308 instead of 301 when :attr:`permanent` is ``True``. By default,
+ ``preserve_request`` is ``False``.
+
**Methods**
.. method:: get_redirect_url(*args, **kwargs)
diff --git a/docs/releases/6.1.txt b/docs/releases/6.1.txt
index dd2a193589..8f7172256e 100644
--- a/docs/releases/6.1.txt
+++ b/docs/releases/6.1.txt
@@ -334,7 +334,9 @@ Forms
Generic Views
~~~~~~~~~~~~~
-* ...
+* The new :attr:`.RedirectView.preserve_request` attribute allows preserving
+ the HTTP method and body during redirects, using 307/308 status codes instead
+ of 302/301.
Internationalization
~~~~~~~~~~~~~~~~~~~~