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
OAuth2TokenMiddleware does not work with Django 1.10 #406
Comments
* Should fix jazzband#406 Should now work with old-style Middleware and the Django 1.10 new style * Added notification concerning the migrations This should prevent others from running into jazzband#405 while trying to create both a swappable instance and swap it out at once
great works! |
I'm experiencing this issue as well. |
not working for me. when added it shows the following...
|
@caxco93 Which Django version are you using? |
@szepczynski do you mean it doesn't work for you! |
@bastbnl it doesn't work I got also this error (caused by OAuth2TokenMiddleware):
|
OK, thanks. I'll look into it and update the pull request Op wo 26 okt. 2016 17:24 schreef Marcin Szepczyński <
|
@szepczynski Could you tell me what happens when you try to run this import from the Django shell? (python manage.py shell):
|
There is a simple fix for this! Just edit the file /oauth2_provider/middleware.py from django.utils.deprecation import MiddlewareMixin and change the class inheritance from "object" to "MiddlewareMixin" For further details see the official Django 1.10 middleware migration page: https://docs.djangoproject.com/el/1.10/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware |
Thanks for your reply. I understand that the easy fix will work on Django 1.10. I intended to create something that will work with Django 1.9 as well. Honesty never checked to see if this class exists on pre 1.10 |
I looked in the code and it seems that the class is present in django 1.9 aswell ;) |
@Axenu You save my life. Thank you so much ^3^ |
@Axenu Just took a look into the 1.9 code on github and didn't see that class on the 1.9 tags. Then again, I don't really know about the deprecation strategy behind this app: should it still work on 1.8 as well? Or even 1.7? It's in the README, btw. I'll take another look and attempt to improve the PR |
I myself just took another look at it and it seems that it is not available in the earlier versions as I previously thought. I suppose another way to work around it would be to rewrite the class with a custom method: |
Whats the status of this issue and #405? Is this library usable on 1.10 at all? Seeing as the fix is simple and there hasnt been activity on it since August, I'm considering whether picking it for oauth support is the correct move. |
Should now work with old-style Middleware and the Django 1.10 new style
@jleclanche I'm using this app on Django 1.10 with the patches I provided and I see it working properly. I believe it is a great app, but I feel the same. No maintainer comments on the PR and people are reporting issues on it, which I can't reproduce. Obviously improving it or fixing it gets hard I say go for it as I haven't found anything that beats it |
Yup. I like how everything works so far. But I agree, no patches or fixes for known Django 1.10 issues. Wonder what happened. @bastbnl @jleclanche |
We're going to be using this app in prod pretty soon so we'll be maintaining a fork of this in git with the patch. If the maintainers (@synasius @Girbons) have disappeared, or are no longer maintaining this project, we'll make it more official but that's really something I want to avoid. Heads up to @evonove: I can help maintain this project if needs be. |
@jleclanche @niknokseyer @bastbnl any help is more than welcome! There are a lot of issues that still need to be triaged and PRs to be reviewed. We're trying to work on it on a regular basis, at least every two weeks, but I know it's not enough. So let me know if any of you guys want to be added as a contributor with write permissions and I'll gladly do that. The only rule is that any "important" change or design choice should be discussed and reviewed together before it can be merged. |
@synasius that's great. I'll keep an eye on the issues and see what I can do once I start using the lib in prod :) Any chance for a release by the way now that it's 1.10 compatible? |
@jleclanche sure! we need to address a couple of issues and then we'll release a new version |
Adding the OAuth2TokenMiddleware to the MIDDLEWARE array will break the application:
Traceback (most recent call last): ... File "/var/www/brownpapersession/dev/env-brownpapersession/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 82, in load_middleware mw_instance = middleware(handler) TypeError: object.__new__() takes no parameters
Mitigation described here: https://docs.djangoproject.com/en/1.10/topics/http/middleware/
The text was updated successfully, but these errors were encountered: