aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar')
-rw-r--r--debug_toolbar/templates/debug_toolbar/base.html1
-rw-r--r--debug_toolbar/toolbar.py13
-rw-r--r--debug_toolbar/utils/settings.py1
3 files changed, 11 insertions, 4 deletions
diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html
index c3cd339..b2ea63e 100644
--- a/debug_toolbar/templates/debug_toolbar/base.html
+++ b/debug_toolbar/templates/debug_toolbar/base.html
@@ -53,6 +53,7 @@ if(!window.jQuery) document.write('<scr'+'ipt src="{{ STATIC_URL }}debug_toolbar
</div>
<div class="djDebugPanelContent">
<div class="scroll">
+ {% if not storage_id %}{{ panel.content }}{% endif %}
</div>
</div>
</div>
diff --git a/debug_toolbar/toolbar.py b/debug_toolbar/toolbar.py
index bf632cd..3f274d0 100644
--- a/debug_toolbar/toolbar.py
+++ b/debug_toolbar/toolbar.py
@@ -51,10 +51,9 @@ class DebugToolbar(object):
Renders the overall Toolbar with panels inside.
"""
context = self.template_context.copy()
- context.update({
- 'panels': self.panels,
- 'storage_id': self.store(),
- })
+ context['panels'] = self.panels
+ if not self.should_render_panels():
+ context['storage_id'] = self.store()
return render_to_string('debug_toolbar/base.html', context)
# Handle storing toolbars in memory and fetching them later on
@@ -62,6 +61,12 @@ class DebugToolbar(object):
_counter = 0
_storage = SortedDict()
+ def should_render_panels(self):
+ render_panels = dt_settings.CONFIG['RENDER_PANELS']
+ if render_panels is None:
+ render_panels = self.request.META['wsgi.multiprocess']
+ return render_panels
+
def store(self):
cls = type(self)
cls._counter += 1
diff --git a/debug_toolbar/utils/settings.py b/debug_toolbar/utils/settings.py
index 45f661f..323e7cf 100644
--- a/debug_toolbar/utils/settings.py
+++ b/debug_toolbar/utils/settings.py
@@ -28,6 +28,7 @@ CONFIG_DEFAULTS = {
'ROOT_TAG_ATTRS': '',
'SQL_WARNING_THRESHOLD': 500, # milliseconds
'RESULTS_CACHE_SIZE': 10,
+ 'RENDER_PANELS': None,
}