-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixes KeyError when indexing request.META #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes KeyError when indexing request.META if 'wsgi.multiprocess' is not present. This was a bug in DebugToolbar.should_render_panels(). Also adds test cases for DebugToolbar.should_render_panels().
|
PEP 3333 says:
If the variable isn't present, that's a bug in your WSGI server. What server are you using? |
|
It is the server of a friend of mine, @uakfdotb, who was testing my pull request to upgrade our version of the debug toolbar [1]. I believe he was using some setup with Apache that did not include WSGI, though I don't know the details. |
|
Oh, right, Django 1.4 still supports mod_python :( |
debug_toolbar/toolbar.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should default to True in order to enable the safe but inefficient behavior on non-WSGI servers.
|
I appreciate the effort you put in writing the tests, but I'm not conviced they add that much value. They're testing the implementation of |
Changes request.META['wsgi.multiprocess'] default to True. This is a correction of 1783d19, so that the safe but inefficient behavior of panel rendering is enabled on non-WSGI servers.
|
I changed the default value.
I can remove some of the other tests if you want. |
Updates test_should_render_panels_RENDER_PANELS_None_wsgi_multiprocess_None() to take into account the change in ad50619. Also removes unneeded tests of should_render_panel().
(Please don't use mod_python.)
This reverts commit 6ce52b2.
Fixes KeyError when indexing request.META if 'wsgi.multiprocess' is not
present. This was a bug in DebugToolbar.should_render_panels().
Also adds test cases for DebugToolbar.should_render_panels().