Skip to content

Commit 9eb8932

Browse files
committed
Fix AppRegistryNotReady error for panels that load models.
The import to the debug_toolbar.middleware also loads all panels. As a panel might be using Django models, such import happens too early.
1 parent 591ac03 commit 9eb8932

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

debug_toolbar/apps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from django.utils.module_loading import import_string
1010
from django.utils.translation import ugettext_lazy as _
1111

12-
from debug_toolbar.middleware import DebugToolbarMiddleware
13-
1412

1513
class DebugToolbarConfig(AppConfig):
1614
name = 'debug_toolbar'
@@ -19,6 +17,8 @@ class DebugToolbarConfig(AppConfig):
1917

2018
@register
2119
def check_middleware(app_configs, **kwargs):
20+
from debug_toolbar.middleware import DebugToolbarMiddleware
21+
2222
errors = []
2323
gzip_index = None
2424
debug_toolbar_index = None

0 commit comments

Comments
 (0)