question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Middleware compatibility with Django 1.10

See original GitHub issue

Since Django 1.10 introduced new middleware style, existing middlewares should be updated. For now I can suggest possible workaround for impatient Django 1.10 users:

from django.utils.deprecation import MiddlewareMixin
from debug_toolbar.middleware import DebugToolbarMiddleware


class AtopdedTo110DebugMiddleware(MiddlewareMixin, DebugToolbarMiddleware):
    pass

And then add it to your MIDDLEWARE settings:

MIDDLEWARE += ['my.middleware.AtopdedTo110DebugMiddleware']

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
AlJohricommented, Sep 26, 2016

any chance you can push a new release with this fix?

2reactions
cdmancommented, Aug 12, 2016

@valentjedi - thank you for the workaround!

Related: the documentation should also be updated: https://django-debug-toolbar.readthedocs.io/en/stable/installation.html#middleware

Read more comments on GitHub >

github_iconTop Results From Across the Web

Middleware - Django documentation
Middleware is a framework of hooks into Django's request/response processing. It's a light, low-level “plugin” system for globally altering Django's input or ...
Read more >
Django 1.10 and Middleware - Stack Overflow
I need Django Debug Toolbar. Release 1.5 is compatible with Django 1.10. This is installation documentation: https://django-debug-toolbar.
Read more >
Compatible Django Middleware - kichik's blog
Django 1.10 added a new style of middleware with a different interface and a new setting called MIDDLWARE instead of MIDDLEWARE_CLASSES .
Read more >
django-cors-headers - PyPI
Basically all of the changes in the forked django-cors-middleware were merged back, ... which still works as an alias, with the new name...
Read more >
Fix middleware for Django>1.10. (!9) - GNU Mailman - GitLab
Fixes the middleware in a backward compatible way.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found