Django 1.10.1 + Wagtail 1.6.2 + django-debug-toolbar 1.5 = KeyError: 'wsgi.multiprocess'
See original GitHub issueI’m using Django 1.10.1 + Wagtail 1.6.2 + django-debug-toolbar 1.5. And when I click “Preview” button in admin interface, I get following error:
[ERROR] [django.request] [exception/handle_uncaught_exception] Internal Server Error: /cmspnl/pages/53/edit/preview/
Traceback (most recent call last):
File "virtualenv\lib\site-packages\django\core\handlers\base.py", line 131, in get_response
response = middleware_method(request, response)
File "virtualenv\lib\site-packages\debug_toolbar\middleware.py", line 122, in process_response
bits[-2] += toolbar.render_toolbar()
File "virtualenv\lib\site-packages\debug_toolbar\toolbar.py", line 60, in render_toolbar
if not self.should_render_panels():
File "virtualenv\lib\site-packages\debug_toolbar\toolbar.py", line 81, in should_render_panels
render_panels = self.request.META['wsgi.multiprocess']
KeyError: 'wsgi.multiprocess'
On other pages (which are also build in Wagtail, but accessed not via preview form) - all works fine. Also on Django 1.9 + Wagtail 1.5 + django-debug-toolbar 1.5 = all works fine too.
I think this issue is Wagtail-related.
I found this problem is related to code:
def should_render_panels(self):
render_panels = self.config['RENDER_PANELS']
if render_panels is None:
render_panels = self.request.META['wsgi.multiprocess']
return render_panels
I’ve tried set RENDER_PANELS
- but after this two Django-Toolbar panels are shown.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Installation of Django Debug Toolbar: TypeError
Django 1.10. django-debug-toolbar==1.5. I am working on a new project (I've just installed Django). Trying to install Django Debug Toolbar.
Read more >Django Debug Toolbar - Read the Docs
Django Debug Toolbar ¶ · The toolbar isn't displayed! · Working with htmx and Turbo · Performance considerations.
Read more >Django Debug Toolbar - Read the Docs
On some platforms, the Django runserver command may use incorrect content types for static assets. To guess content types, Django relies on ...
Read more >Wagtail 1.6.3 release notes
... with django-debug-toolbar 1.5 (Matt Westcott). Edits to StreamFields are no longer ignored in page edits on Django >=1.10.1 when a ...
Read more >Installing Django Debug Toolbar with Wagtail CMS - YouTube
Learn how to add one of the most useful Django debugging tools into your new Wagtail project. We'll go through the installation docs, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Currently this is the setting that works for me:
settings.py
With this only one debug toolbar is shown in the page, as the other one is excluded.
I’m looking at this code: https://github.com/torchbox/wagtail/blob/3b4c24e0b59638fb695cfd0f2637b8e5bc595214/wagtail/wagtailcore/models.py#L1209-L1216
It should contain all values specified as mandatory by the WSGI spec: https://www.python.org/dev/peps/pep-3333/#environ-variables