diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py index fd3312bc3..de18f95e3 100644 --- a/debug_toolbar/panels/__init__.py +++ b/debug_toolbar/panels/__init__.py @@ -10,7 +10,7 @@ class Panel: Base class for panels. """ - is_async = True + is_async = False def __init__(self, toolbar, get_response): self.toolbar = toolbar diff --git a/debug_toolbar/panels/alerts.py b/debug_toolbar/panels/alerts.py index 51334820d..c8e59002c 100644 --- a/debug_toolbar/panels/alerts.py +++ b/debug_toolbar/panels/alerts.py @@ -76,6 +76,8 @@ class AlertsPanel(Panel): title = _("Alerts") + is_async = True + template = "debug_toolbar/panels/alerts.html" def __init__(self, *args, **kwargs): diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py index 4c7bf5af7..0f8902b5a 100644 --- a/debug_toolbar/panels/cache.py +++ b/debug_toolbar/panels/cache.py @@ -58,6 +58,8 @@ class CachePanel(Panel): template = "debug_toolbar/panels/cache.html" + is_async = True + _context_locals = Local() def __init__(self, *args, **kwargs): diff --git a/debug_toolbar/panels/headers.py b/debug_toolbar/panels/headers.py index e1ea6da1e..f6086d6e6 100644 --- a/debug_toolbar/panels/headers.py +++ b/debug_toolbar/panels/headers.py @@ -30,6 +30,8 @@ class HeadersPanel(Panel): title = _("Headers") + is_async = True + template = "debug_toolbar/panels/headers.html" def process_request(self, request): diff --git a/debug_toolbar/panels/redirects.py b/debug_toolbar/panels/redirects.py index 71c008f1b..27cce4c17 100644 --- a/debug_toolbar/panels/redirects.py +++ b/debug_toolbar/panels/redirects.py @@ -11,9 +11,10 @@ class RedirectsPanel(Panel): Panel that intercepts redirects and displays a page with debug info. """ - is_async = True has_content = False + is_async = True + nav_title = _("Intercept redirects") def _process_response(self, response): diff --git a/debug_toolbar/panels/request.py b/debug_toolbar/panels/request.py index f9375b381..9e60207fe 100644 --- a/debug_toolbar/panels/request.py +++ b/debug_toolbar/panels/request.py @@ -15,8 +15,6 @@ class RequestPanel(Panel): title = _("Request") - is_async = False - @property def nav_subtitle(self): """ diff --git a/debug_toolbar/panels/settings.py b/debug_toolbar/panels/settings.py index 7b27c6243..ff32bd2c0 100644 --- a/debug_toolbar/panels/settings.py +++ b/debug_toolbar/panels/settings.py @@ -14,6 +14,8 @@ class SettingsPanel(Panel): template = "debug_toolbar/panels/settings.html" + is_async = True + nav_title = _("Settings") def title(self): diff --git a/debug_toolbar/panels/signals.py b/debug_toolbar/panels/signals.py index 574948d6e..db0d4961d 100644 --- a/debug_toolbar/panels/signals.py +++ b/debug_toolbar/panels/signals.py @@ -28,6 +28,8 @@ class SignalsPanel(Panel): template = "debug_toolbar/panels/signals.html" + is_async = True + SIGNALS = { "request_started": request_started, "request_finished": request_finished, diff --git a/debug_toolbar/panels/staticfiles.py b/debug_toolbar/panels/staticfiles.py index 061068a30..2eed2efa0 100644 --- a/debug_toolbar/panels/staticfiles.py +++ b/debug_toolbar/panels/staticfiles.py @@ -73,7 +73,6 @@ class StaticFilesPanel(panels.Panel): A panel to display the found staticfiles. """ - is_async = False name = "Static files" template = "debug_toolbar/panels/staticfiles.html" diff --git a/debug_toolbar/panels/templates/panel.py b/debug_toolbar/panels/templates/panel.py index ee2a066c7..e9a5b4e83 100644 --- a/debug_toolbar/panels/templates/panel.py +++ b/debug_toolbar/panels/templates/panel.py @@ -68,6 +68,8 @@ class TemplatesPanel(Panel): A panel that lists all templates used during processing of a response. """ + is_async = True + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.templates = [] diff --git a/debug_toolbar/panels/timer.py b/debug_toolbar/panels/timer.py index 962702f7e..554798e7d 100644 --- a/debug_toolbar/panels/timer.py +++ b/debug_toolbar/panels/timer.py @@ -17,8 +17,6 @@ class TimerPanel(Panel): Panel that displays the time a response took in milliseconds. """ - is_async = False - def nav_subtitle(self): stats = self.get_stats() if hasattr(self, "_start_rusage"): diff --git a/debug_toolbar/panels/versions.py b/debug_toolbar/panels/versions.py index d517ecfb3..2b41377ca 100644 --- a/debug_toolbar/panels/versions.py +++ b/debug_toolbar/panels/versions.py @@ -12,6 +12,8 @@ class VersionsPanel(Panel): Shows versions of Python, Django, and installed apps if possible. """ + is_async = True + @property def nav_subtitle(self): return "Django %s" % django.get_version() diff --git a/docs/architecture.rst b/docs/architecture.rst index c49bfef0f..0c267c806 100644 --- a/docs/architecture.rst +++ b/docs/architecture.rst @@ -82,7 +82,7 @@ Problematic Parts - Support for async and multi-threading: ``debug_toolbar.middleware.DebugToolbarMiddleware`` is now async compatible and can process async requests. However certain panels such as ``SQLPanel``, ``TimerPanel``, ``StaticFilesPanel``, - ``RequestPanel`` and ``ProfilingPanel`` aren't fully + ``RequestPanel``, ``HistoryPanel`` and ``ProfilingPanel`` aren't fully compatible and currently being worked on. For now, these panels are disabled by default when running in async environment. follow the progress of this issue in `Async compatible toolbar project `_.