[damned-lies] Fix use of DjangoDebugToolbar



commit a7adcc0c516562296e84333edccddb8ba5f4dcd9
Author: Guillaume Bernard <associations guillaume-bernard fr>
Date:   Sat Jun 30 16:10:35 2018 +0000

    Fix use of DjangoDebugToolbar

 damnedlies/settings.py | 2 +-
 damnedlies/urls.py     | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/damnedlies/settings.py b/damnedlies/settings.py
index 4f652847..a3cbc803 100644
--- a/damnedlies/settings.py
+++ b/damnedlies/settings.py
@@ -190,5 +190,5 @@ if DEBUG:
     EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
 
 if USE_DEBUG_TOOLBAR:
-    MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware')
+    MIDDLEWARE.insert(0, 'debug_toolbar.middleware.DebugToolbarMiddleware')
     INSTALLED_APPS.append('debug_toolbar')
diff --git a/damnedlies/urls.py b/damnedlies/urls.py
index 7e2212e3..5668db97 100644
--- a/damnedlies/urls.py
+++ b/damnedlies/urls.py
@@ -107,6 +107,12 @@ urlpatterns += [
          stats_views.compare_by_releases),
 ]
 
+if settings.USE_DEBUG_TOOLBAR:
+    import debug_toolbar
+    urlpatterns += [
+        path('__debug__/', include(debug_toolbar.urls)),
+    ]
+
 if settings.STATIC_SERVE:
     urlpatterns += [
         path('media/<path:path>',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]