From 0368d75afbe578951bcded286a3122c5302e3e4d Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 6 Oct 2008 00:29:33 -0400 Subject: warn the user if they have the middleware in the wrong order --- debug_toolbar/middleware.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'debug_toolbar') 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 -- cgit v1.2.3