diff options
| author | Aymeric Augustin | 2013-11-30 13:37:37 +0100 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-11-30 13:48:24 +0100 | 
| commit | dc04efa74316676ff73330b01e79b2debae1df9f (patch) | |
| tree | 61efd9613a60ee7c65119037188932746cf9caae | |
| parent | 4b712fda71cd3301507c31e8ef835c0de105005a (diff) | |
| download | django-debug-toolbar-dc04efa74316676ff73330b01e79b2debae1df9f.tar.bz2 | |
Reduce the risk of circular imports.
| -rw-r--r-- | debug_toolbar/__init__.py | 6 | ||||
| -rw-r--r-- | debug_toolbar/toolbar.py | 3 | 
2 files changed, 6 insertions, 3 deletions
| diff --git a/debug_toolbar/__init__.py b/debug_toolbar/__init__.py index 12a7fc8..7ebd1c7 100644 --- a/debug_toolbar/__init__.py +++ b/debug_toolbar/__init__.py @@ -11,7 +11,7 @@ except Exception:      VERSION = 'unknown' -from .toolbar import DebugToolbar +# Code that discovers files or modules in INSTALLED_APPS imports this module. +# Reference URLpatterns with a string to avoid the risk of circular imports. - -urls = DebugToolbar.get_urls(), 'djdt', 'djdt' +urls = 'debug_toolbar.toolbar', 'djdt', 'djdt' diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py index 80b6dff..36c301a 100644 --- a/debug_toolbar/toolbar.py +++ b/debug_toolbar/toolbar.py @@ -130,3 +130,6 @@ class DebugToolbar(object):                  urlpatterns += panel_class.get_urls()              cls._urlpatterns = urlpatterns          return cls._urlpatterns + + +urlpatterns = DebugToolbar.get_urls() | 
