diff options
Diffstat (limited to 'debug_toolbar/toolbar.py')
| -rw-r--r-- | debug_toolbar/toolbar.py | 13 |
1 files changed, 9 insertions, 4 deletions
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 |
