File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 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"
24
35# Do not use pkg_resources to find the version but set it here directly!
46# see issue #1446
57VERSION = "3.2.4"
68
79# 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 1414from django .urls .exceptions import Resolver404
1515from django .utils .module_loading import import_string
1616
17- from debug_toolbar import settings as dt_settings
17+ from debug_toolbar import APP_NAME , settings as dt_settings
1818
1919
2020class DebugToolbar :
@@ -144,8 +144,6 @@ def is_toolbar_request(cls, request):
144144 """
145145 Determine if the request is for a DebugToolbar view.
146146 """
147- from debug_toolbar .urls import app_name
148-
149147 # The primary caller of this function is in the middleware which may
150148 # not have resolver_match set.
151149 try :
@@ -154,7 +152,7 @@ def is_toolbar_request(cls, request):
154152 )
155153 except Resolver404 :
156154 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
158156
159157 @staticmethod
160158 @lru_cache (maxsize = 128 )
Original file line number Diff line number Diff line change 1+ from debug_toolbar import APP_NAME
12from debug_toolbar .toolbar import DebugToolbar
23
3- app_name = "djdt" # See debug_toolbar/__init__.py
4+ app_name = APP_NAME
45urlpatterns = DebugToolbar .get_urls ()
You can’t perform that action at this time.
0 commit comments