diff --git a/README.rst b/README.rst index 44279cee3..f6e8253e5 100644 --- a/README.rst +++ b/README.rst @@ -27,6 +27,11 @@ If you have ideas for other panels please let us know. * Note: The Debug Toolbar only works on Django 1.2 and newer. +To disable the toolbar on a per request basis, add DISABLE to the query string:: + +http://domain.com/path?DISABLE=disable + + Installation ============ diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 6e86223b6..4927c2092 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -63,6 +63,9 @@ def _show_toolbar(self, request): if getattr(settings, 'TEST', False): return False + if request.REQUEST.get('DISABLE', False): + return False + x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR', None) if x_forwarded_for: remote_addr = x_forwarded_for.split(',')[0].strip()