Skip to content
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

Upgrading to Django 1.7 gives 500 internal server error when requesting access token #96

Open
psychok7 opened this issue Sep 9, 2014 · 12 comments

Comments

@psychok7
Copy link

psychok7 commented Sep 9, 2014

When using Django 1.6 everything seems to work fine, if i request an access token i get it:

curl -X POST -d "client_id=0ca3f7c5ebbee468f266&client_secret=0dfc806ee685c0ffe7b47f7a0702edd77f8fa0ba&grant_type=password&username=manel&password=manel" http://vagrant-khan:8000/oauth2/access_token/

The problem is when i upgrade to Django 1.7 where i only get a 500 internal server error but it still creates the access token in the database. Can you confirm this bug and provide a fix?

@andreac
Copy link

andreac commented Sep 16, 2014

+1 same error, please fix it

@stefan-wegener
Copy link

This issue is already discussed in #77 .
For me replacing all occurences of mimetype=... with content_type=... in /usr/local/lib/python2.7/dist-packages/provider/views.py worked.

@psychok7
Copy link
Author

@stefan-wegener probably, but its not yet merged in master if am not mistaken.

i have made a switch to django-oauth-toolkit because its seems to me its better mantained (regarding merges and patches) ill come back to this if i see more updates

@andreac
Copy link

andreac commented Sep 16, 2014

thanks @stefan-wegener now it works for me ;)

@stefan-wegener
Copy link

@psychok7 You are right, its currently not merged into master. There is already a pull request for this #97 . The question there is, if it is backwars compatible. As I am also new to python, I can not answer this question. So we have to wait for someone more experienced who can confirm, if this request is backwars-compatible or suggest another solution.

@psychok7
Copy link
Author

Yeah i understand that and that's the thing with open source, you cant really blame ppl since no one is getting paid. but unfortunately i need to propose "stable" solutions in my company and i have deadlines and this 500 error made me loose an afternoon already and the first reply to this thread was 1 week after it was opened :( . i would probably use that patch if i knew it also solved this problem (i had already seen it)

@jrmiddle
Copy link

I haven't received any feedback, and haven't had time to go back myself and see how far back this breaks things—however it looks like "mimetype" was deprecated a while back.

AFAICT if you're using 1.7 only, then forking and applying the patch should do the trick; I reference my own fork in my requirements.txt rather than this repo:

-e [email protected]:jrmiddle/django-oauth2-provider.git#egg=django-oauth2-provider

It probably works with 1.6, but I haven't tested it. I don't know what additional changes (if any) the author is planning for 1.7, but as the patch as it stands is tiny, the risk should be low.

@beaugunderson
Copy link

There's a PR open that fixes this (#78).

@beaugunderson
Copy link

There's actually another PR that also fixes tests for 1.7 that I'll lobby to get merged; it's #93.

@jrmiddle
Copy link

Happy 2015. Just checking on the status of the official fix for this—any thoughts?

@beaugunderson
Copy link

I switched to django-oauth-toolkit and found it a fairly painless transition. :)

@jrmiddle
Copy link

Ah, thanks @beaugunderson — will check it out!

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

No branches or pull requests

5 participants