File tree 3 files changed +8
-7
lines changed
3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
- __all__ = ["VERSION" ]
1
+ __all__ = ["APP_NAME" , "VERSION" ]
2
+
3
+ APP_NAME = "djdt"
2
4
3
5
# Do not use pkg_resources to find the version but set it here directly!
4
6
# see issue #1446
5
7
VERSION = "3.2.4"
6
8
7
9
# Code that discovers files or modules in INSTALLED_APPS imports this module.
8
- urls = "debug_toolbar.urls" , "djdt" # See debug_toolbar/urls.py
10
+ urls = "debug_toolbar.urls" , APP_NAME
Original file line number Diff line number Diff line change 14
14
from django .urls .exceptions import Resolver404
15
15
from django .utils .module_loading import import_string
16
16
17
- from debug_toolbar import settings as dt_settings
17
+ from debug_toolbar import APP_NAME , settings as dt_settings
18
18
19
19
20
20
class DebugToolbar :
@@ -144,8 +144,6 @@ def is_toolbar_request(cls, request):
144
144
"""
145
145
Determine if the request is for a DebugToolbar view.
146
146
"""
147
- from debug_toolbar .urls import app_name
148
-
149
147
# The primary caller of this function is in the middleware which may
150
148
# not have resolver_match set.
151
149
try :
@@ -154,7 +152,7 @@ def is_toolbar_request(cls, request):
154
152
)
155
153
except Resolver404 :
156
154
return False
157
- return resolver_match .namespaces and resolver_match .namespaces [- 1 ] == app_name
155
+ return resolver_match .namespaces and resolver_match .namespaces [- 1 ] == APP_NAME
158
156
159
157
@staticmethod
160
158
@lru_cache (maxsize = 128 )
Original file line number Diff line number Diff line change
1
+ from debug_toolbar import APP_NAME
1
2
from debug_toolbar .toolbar import DebugToolbar
2
3
3
- app_name = "djdt" # See debug_toolbar/__init__.py
4
+ app_name = APP_NAME
4
5
urlpatterns = DebugToolbar .get_urls ()
You can’t perform that action at this time.
0 commit comments