diff options
| author | Reto Aebersold | 2009-01-17 12:21:27 -0800 | 
|---|---|---|
| committer | Rob Hudson | 2009-01-17 12:21:27 -0800 | 
| commit | 184277b5d9a4658eb326d8f679618284299554a2 (patch) | |
| tree | 562b178653a8e85393caf48aca57c443f5bb5db2 /debug_toolbar/middleware.py | |
| parent | 9d335bed8c83981370429833d1c5fd7f31b97a5e (diff) | |
| download | django-debug-toolbar-184277b5d9a4658eb326d8f679618284299554a2.tar.bz2 | |
Fixing AJAX calls to detailed SQL views.
Signed-off-by: Rob Hudson <rob@cogit8.org>
Diffstat (limited to 'debug_toolbar/middleware.py')
| -rw-r--r-- | debug_toolbar/middleware.py | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 8dcf454..c3cf5f9 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -8,6 +8,8 @@ from django.utils.encoding import smart_unicode  from django.conf.urls.defaults import include, patterns  import debug_toolbar.urls  from debug_toolbar.toolbar.loader import DebugToolbar +from debug_toolbar.urls import DEBUG_TB_URL_PREFIX +import os  _HTML_TYPES = ('text/html', 'application/xhtml+xml') @@ -37,7 +39,7 @@ class DebugToolbarMiddleware(object):      def show_toolbar(self, request):          if not settings.DEBUG:              return False -        if request.is_ajax(): +        if request.is_ajax() and not request.path.startswith(os.path.join('/', DEBUG_TB_URL_PREFIX)): #Allow ajax requests from the debug toolbar              return False          if not request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS:              return False | 
