diff --git a/debug_toolbar/panels/redirects.py b/debug_toolbar/panels/redirects.py index 8055c67ad..1db439723 100644 --- a/debug_toolbar/panels/redirects.py +++ b/debug_toolbar/panels/redirects.py @@ -1,3 +1,4 @@ +import warnings from inspect import iscoroutine from django.template.response import SimpleTemplateResponse @@ -17,6 +18,17 @@ class RedirectsPanel(Panel): nav_title = _("Intercept redirects") + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + warnings.warn( + "The RedirectsPanel is deprecated and will be removed in a future version. " + "The HistoryPanel now provides the ability to view toolbar data for redirected requests. " + "If you still have a use case for this panel, please comment on " + "https://github.com/django-commons/django-debug-toolbar/issues/2216", + DeprecationWarning, + stacklevel=2, + ) + def _process_response(self, response): """ Common response processing logic. diff --git a/debug_toolbar/templates/debug_toolbar/redirect.html b/debug_toolbar/templates/debug_toolbar/redirect.html index 46897846d..cb2bef316 100644 --- a/debug_toolbar/templates/debug_toolbar/redirect.html +++ b/debug_toolbar/templates/debug_toolbar/redirect.html @@ -4,8 +4,71 @@
diff --git a/docs/changes.rst b/docs/changes.rst
index 667251b4f..d7c92cbee 100644
--- a/docs/changes.rst
+++ b/docs/changes.rst
@@ -16,6 +16,8 @@ Pending
* Upgraded CI ``postgis`` version to 17-3.5.
* Added how to generate the documentation locally to the contributing
documentation.
+* Deprecated ``RedirectsPanel`` in favor of ``HistoryPanel`` for viewing
+ toolbar data from redirected requests.
* Updated logic that forces values to strings (``force_str``) to render
"Django Debug Toolbar was unable to parse value." when there's a decoding
error.
diff --git a/docs/panels.rst b/docs/panels.rst
index f2364ea7c..5f1b37b4f 100644
--- a/docs/panels.rst
+++ b/docs/panels.rst
@@ -120,6 +120,13 @@ Redirects
.. class:: debug_toolbar.panels.redirects.RedirectsPanel
+.. deprecated:: 6.0
+
+The RedirectsPanel is deprecated and will be removed in a future version.
+The HistoryPanel now provides the ability to view toolbar data for redirected
+requests. If you have a use case for this panel, please comment on the
+GitHub issue