Skip to content

Commit 83918d2

Browse files
authored
Merge pull request #892 from gregplaysguitar/master
update url namespace format. fixes #881
2 parents 19da31b + 06d72b9 commit 83918d2

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

debug_toolbar/__init__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import absolute_import, unicode_literals
22

3+
import django
4+
35
__all__ = ['VERSION']
46

57

@@ -11,9 +13,14 @@
1113

1214

1315
# 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-
16-
urls = 'debug_toolbar.toolbar', 'djdt', 'djdt'
17-
16+
# URLpatterns were referenced with a string prior to 1.9 to avoid the risk of
17+
# circular imports
18+
19+
if django.VERSION < (1, 9):
20+
urls = 'debug_toolbar.toolbar', 'djdt', 'djdt'
21+
else:
22+
from . import toolbar
23+
toolbar.app_name = 'djdt'
24+
urls = toolbar
1825

1926
default_app_config = 'debug_toolbar.apps.DebugToolbarConfig'

0 commit comments

Comments
 (0)