diff --git a/debug_toolbar/panels/history/panel.py b/debug_toolbar/panels/history/panel.py index 0382cad62..0cc352e8b 100644 --- a/debug_toolbar/panels/history/panel.py +++ b/debug_toolbar/panels/history/panel.py @@ -21,6 +21,12 @@ class HistoryPanel(Panel): nav_title = _("History") template = "debug_toolbar/panels/history.html" + @property + def enabled(self): + # Do not show the history panel if the panels are rendered on request + # rather than loaded via ajax. + return super().enabled and not self.toolbar.should_render_panels() + @property def is_historical(self): """The HistoryPanel should not be included in the historical panels.""" diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index 78b9b7fe2..7abc5476f 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -7,7 +7,10 @@ {% endblock %}