File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11
11
12
12
13
13
# Code that discovers files or modules in INSTALLED_APPS imports this module.
14
- # Reference URLpatterns with a string to avoid the risk of circular imports.
15
14
16
- urls = 'debug_toolbar.toolbar' , 'djdt' , 'djdt'
15
+ # Reference URLpatterns with an iterator to avoid circular imports.
16
+
17
+ def urlpatterns ():
18
+ from debug_toolbar .toolbar import DebugToolbar
19
+ for pattern in DebugToolbar .get_urls ():
20
+ yield pattern
21
+
22
+
23
+ urls = urlpatterns (), 'djdt' , 'djdt'
17
24
18
25
19
26
default_app_config = 'debug_toolbar.apps.DebugToolbarConfig'
Original file line number Diff line number Diff line change @@ -146,6 +146,3 @@ def get_urls(cls):
146
146
urlpatterns += panel_class .get_urls ()
147
147
cls ._urlpatterns = urlpatterns
148
148
return cls ._urlpatterns
149
-
150
-
151
- urlpatterns = DebugToolbar .get_urls ()
You can’t perform that action at this time.
0 commit comments