File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
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 APP_NAME
1718from debug_toolbar import settings as dt_settings
1819
1920
@@ -144,8 +145,6 @@ def is_toolbar_request(cls, request):
144145 """
145146 Determine if the request is for a DebugToolbar view.
146147 """
147- from debug_toolbar .urls import app_name
148-
149148 # The primary caller of this function is in the middleware which may
150149 # not have resolver_match set.
151150 try :
@@ -154,7 +153,7 @@ def is_toolbar_request(cls, request):
154153 )
155154 except Resolver404 :
156155 return False
157- return resolver_match .namespaces and resolver_match .namespaces [- 1 ] == app_name
156+ return resolver_match .namespaces and resolver_match .namespaces [- 1 ] == APP_NAME
158157
159158 @staticmethod
160159 @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