Skip to content

Commit 5d79c1f

Browse files
committed
Added the ability to disable the toolbar on a per request basis.
1 parent 119874f commit 5d79c1f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ If you have ideas for other panels please let us know.
2727

2828
* Note: The Debug Toolbar only works on Django 1.2 and newer.
2929

30+
To disable the toolbar on a per request basis, add DISABLE to the query string::
31+
32+
http://domain.com/path?DISABLE=disable
33+
34+
3035
Installation
3136
============
3237

debug_toolbar/middleware.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def _show_toolbar(self, request):
6363
if getattr(settings, 'TEST', False):
6464
return False
6565

66+
if request.REQUEST.get('DISABLE', False):
67+
return False
68+
6669
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR', None)
6770
if x_forwarded_for:
6871
remote_addr = x_forwarded_for.split(',')[0].strip()

0 commit comments

Comments
 (0)