summaryrefslogtreecommitdiff
path: root/patchwork/urls.py
diff options
context:
space:
mode:
authorStephen Finucane <stephen.finucane@intel.com>2016-03-23 18:24:03 +0000
committerStephen Finucane <stephen.finucane@intel.com>2016-03-24 17:34:58 +0000
commit34ccee4a2b2b332c4b0967e5fcb691f72a44478e (patch)
tree315fa049ce2bb9ea78d9733446be673db93b4c19 /patchwork/urls.py
parentcab52992449611f74bcdff1b456af8149de29f8b (diff)
downloadpatchwork-34ccee4a2b2b332c4b0967e5fcb691f72a44478e.tar
patchwork-34ccee4a2b2b332c4b0967e5fcb691f72a44478e.tar.gz
settings: Use explicit setup for the Debug Toolbar
The 'django-debug-toolbar' application provides an automatic method of configuring the plugin. However, as noted in the documentation [1], this can cause issues like circular imports. In this case, a "Table 'patchwork.patchwork_state' doesn't exist" exception was being raised when attempting to do an initial migration. Resolve this by using the manual configuration provided in the docs. [1] https://django-debug-toolbar.readthedocs.org/en/1.4/installation.html Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Closes-bug: #29 --- v2: Don't rely on 'settings.DEBUG', as this is set to False in tests
Diffstat (limited to 'patchwork/urls.py')
-rw-r--r--patchwork/urls.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/patchwork/urls.py b/patchwork/urls.py
index 022b92c..bf8a123 100644
--- a/patchwork/urls.py
+++ b/patchwork/urls.py
@@ -17,6 +17,7 @@
# along with Patchwork; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+import django
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
@@ -122,6 +123,12 @@ urlpatterns = [
url(r'^help/(?P<path>.*)$', help_views.help, name='help'),
]
+if 'debug_toolbar' in settings.INSTALLED_APPS:
+ import debug_toolbar
+ urlpatterns += [
+ url(r'^__debug__/', include(debug_toolbar.urls)),
+ ]
+
if settings.ENABLE_XMLRPC:
urlpatterns += [
url(r'xmlrpc/$', xmlrpc_views.xmlrpc, name='xmlrpc'),