-
Notifications
You must be signed in to change notification settings - Fork 143
Migrate to New Middleware style #2662 #2663
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
Migrate to New Middleware style #2662 #2663
Conversation
In Django 1.10, the old `MIDDLEWARE_CLASSES` style was deprecated and we should now use `MIDDLEWARE` setting. This commit includes this move and takes advantage of the new MiddlewareMixin to help provide compatibility for our custom middleware.
I finally could find a way to trigger this middleware. I had to try a lot of different "breaking" things but I believe I have it narrowed down to the following:
We can thus see that our custom middleware is indeed at play: As a reminder, this middleware also creates a tarball of rockstor's logs at the following path: All thus seems to behave as it should! |
|
@FroggyFlox Thanks for doing the exception testing on this one. Much appreciated. |
|
@FroggyFlox Thanks for seeing to all these stragglers. All pushing us towards a smoother transition to our next major Django version. |
Fixes #2662
@phillxnet, @Hooverdan96: ready for review.
In Django 1.10, the old
MIDDLEWARE_CLASSESstyle was deprecated and we should now useMIDDLEWAREsetting.This Pull Request (PR) includes this move and takes advantage of the new MiddlewareMixin to help provide compatibility for our custom middleware.
With this commit in place, I no-longer see the DJango Warning described in #2662.
All unit tests still pass:
IMPORTANT
I have not yet tested that our custom middleware still works, unfortunately. I would need to find a way to trigger an exception and verify we still have the creation of the logs tarball.