From 142caaa979645ff78b1928a018bb0a83e02a4218 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 15 Oct 2013 10:01:47 +0200 Subject: Disable insertion in streaming responses. --- debug_toolbar/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debug_toolbar/middleware.py') diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 1ad1942..090e206 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -117,10 +117,10 @@ class DebugToolbarMiddleware(object): __traceback_hide__ = True ident = threading.currentThread().ident toolbar = self.__class__.debug_toolbars.get(ident) - if not toolbar or request.is_ajax(): + if not toolbar or request.is_ajax() or getattr(response, 'streaming', False): return response if isinstance(response, HttpResponseRedirect): - if not toolbar.config['INTERCEPT_REDIRECTS'] or request.is_ajax(): + if not toolbar.config['INTERCEPT_REDIRECTS']: return response redirect_to = response.get('Location', None) if redirect_to: -- cgit v1.2.3