aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor2008-10-06 00:29:33 -0400
committerAlex Gaynor2008-10-06 00:29:33 -0400
commit0368d75afbe578951bcded286a3122c5302e3e4d (patch)
tree3a6fad3e1c3b98901118aed892fcbe7d3c0e1c03
parent04e1d2e242aa752c63c63066a38064438f9d2e97 (diff)
downloaddjango-debug-toolbar-0368d75afbe578951bcded286a3122c5302e3e4d.tar.bz2
warn the user if they have the middleware in the wrong order
-rw-r--r--debug_toolbar/middleware.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py
index 9dd9954..11ff4dd 100644
--- a/debug_toolbar/middleware.py
+++ b/debug_toolbar/middleware.py
@@ -44,6 +44,11 @@ class DebugToolbarMiddleware(object):
return True
def process_request(self, request):
+ if not hasattr(request, 'user'):
+ import warnings
+ warnings.warn("You should place the debug_toolbar middleware after \
+ the AuthenticationMiddleware, if you aren't using django's auth\
+ app you can safely ignore this message.")
if self.override_url:
debug_toolbar.urls.urlpatterns += self.original_pattern
self.override_url = False