Skip to content

Restructure the Panel class to execute more like the MIDDLEWARE #1140

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

Merged
merged 1 commit into from
Mar 21, 2019
Merged

Restructure the Panel class to execute more like the MIDDLEWARE #1140

merged 1 commit into from
Mar 21, 2019

Conversation

jdufresne
Copy link
Contributor

This allows the ProfilingPanel to no longer skip remaining panels or middlewares.

This change is backwards incompatible. Third party panels will need to adjust to use this new architecture. It removes support for Django 1.11's deprecated MIDDLEWARE_CLASSES setting.

The Panel.__init__() method is now passed a get_response argument. The Panel.process_request() method must now always return a response. Usually this is the response returned by get_response() but may also return a different response as is the case in the RedirectsPanel.

Panel.process_response() and Panel.process_view() have been removed.

Fixes #1135

@matthiask
Copy link
Member

This is an excellent idea. I should probably polish the state of current things and publish a release first.

@auvipy
Copy link
Contributor

auvipy commented Feb 24, 2019

@matthiask that would be a better approach.

This allows the ProfilingPanel to no longer skip remaining panels or
middlewares.

This change is backwards incompatible. Third party panels will need to
adjust to use this new architecture. It removes support for Django
1.11's deprecated MIDDLEWARE_CLASSES setting.

The Panel.__init__() method is now passed a get_response argument. The
Panel.process_request() method must now always return a response.
Usually this is the response returned by get_response() but may also
return a different response as is the case in the ``RedirectsPanel``.

Panel.process_response() and Panel.process_view() have been removed.

Fixes #1135
@jdufresne
Copy link
Contributor Author

This is an excellent idea. I should probably polish the state of current things and publish a release first.

That sounds good to me. Ping me if you need me to rebase or modify anything after that goes through.

@jdufresne
Copy link
Contributor Author

@matthiask @auvipy If we're going to introduce backwards incompatibility, maybe we get some other cases out of the way at the same time. WDYT? Some that come to mind:

  • Drop Python 2 support
  • All the deprecation warnings in debug_toolbar/settings.py get_config()
  • debug_toolbar.panels.DebugPanel

If this is agreeable, I can submit separate PRs for those points.

@auvipy
Copy link
Contributor

auvipy commented Mar 2, 2019

IMHO, it's time to drop python 2 from next major release which breaks BC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants