Skip to content

Commit 02c872a

Browse files
committed
Instantiate each panel when DebugToolbarConfig is ready.
This allows the cache panel to enable the instrumentation when the app is ready.
1 parent a0f8e1e commit 02c872a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

debug_toolbar/apps.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ class DebugToolbarConfig(AppConfig):
1414
name = "debug_toolbar"
1515
verbose_name = _("Debug Toolbar")
1616

17+
def ready(self):
18+
from debug_toolbar.toolbar import DebugToolbar
19+
20+
# Import the panels when the app is ready. This allows panels
21+
# like CachePanel to enable the instrumentation immediately.
22+
DebugToolbar.get_panel_classes()
23+
1724

1825
@register
1926
def check_middleware(app_configs, **kwargs):

0 commit comments

Comments
 (0)