diff options
| author | Aymeric Augustin | 2013-11-18 08:43:25 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-18 08:43:40 +0100 |
| commit | efdd0ce313052dc390c0001b5dc8c56e888514d0 (patch) | |
| tree | 99dd848bfe0b8fcae0f6f798aadfa96acbdef99f /debug_toolbar/middleware.py | |
| parent | 7697c93692cb251acec174e91431f6aa2b1ebce5 (diff) | |
| download | django-debug-toolbar-efdd0ce313052dc390c0001b5dc8c56e888514d0.tar.bz2 | |
Add an option to collapse the toolbar by default.
Fix #258.
Diffstat (limited to 'debug_toolbar/middleware.py')
| -rw-r--r-- | debug_toolbar/middleware.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 72f190e..bda784d 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -93,6 +93,8 @@ class DebugToolbarMiddleware(object): response = new_response for panel in reversed(toolbar.enabled_panels): panel.disable_instrumentation() + if toolbar.config['SHOW_COLLAPSED'] and 'djdt' not in request.COOKIES: + response.set_cookie('djdt', 'hide', 864000) if ('gzip' not in response.get('Content-Encoding', '') and response.get('Content-Type', '').split(';')[0] in _HTML_TYPES): response.content = replace_insensitive( |
