-
Notifications
You must be signed in to change notification settings - Fork 31
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
Documentation out of date WRT App Engine requests support #38
Comments
I tried this about 2 months ago, but it still wasn't working. There's another open issue somewhere talking about it... But I can't seem to find it during a quick skim. Are you using GAE? If so, wanna help test? I'd be happy to remove the warning if it is indeed working now =) |
So, with much wrangling, I was able to get it to work. Here's what I had to do. First, your call to platform() in http.py doesn't inside the GAE sandbox. That was simple enough to fix; I just check if it's a GAE environment and imagine that up as another OS:
Then, you need to enable open_ssl in your app.yaml file:
Now the ugly part. To bypass an SDK bug, you have to whitelist the _ssl and _socket libraries, then monkey-patch the Python socket library over the SDK one. That's about it. Having said that, all of that seems a bit ... unnecessary given that there's a very nice http fetch service built into GAE, which would be preferable to use. |
Ouch! So, this is essentially what I bumped into the last time I tried this. As the library maintainer, it's sorta a difficult call, but going through all this trouble to maintain compatibility for a service which is breaking HTTP requests on purpose is sorta... odd. It feels wrong to include this stuff in the core library here as it involves a lot of 'hackery' which makes things messy. Thanks so much for going through all the trouble above though. I think that at the very least, any future user who wants to make this work on GAE can reference this and hopefully take it from there. |
Yeah, Google App Engine is a weird asterisks in the world of Python. I don't know the details, but originally Google said basically "no sockets." Now they said "yes, sockets" but they replace the default sockets library with their own, which plays nicer with their sandbox. So yeah, it's a little rough... And weird. But GAE is a very nice little SDK if you can live within its limits, and it would be nice if Stormpath could run inside it. Your actual use of the requests module is limited to only a few lines, and for that matter, you could just as easily use urllib which GAE does a better job of supporting. I'll send over a patch that makes it work, hacky as it is. |
Just reading the latest docs.
Fortunately that issue has long since been closed and the requests module does generally work now in GAE. I'm not sure if there are any other issues with using stormpath on GAE.
The text was updated successfully, but these errors were encountered: