相关疑难解决方法(0)

在Google App Engine中使用Requests python库

我正在尝试在Google App Engine上使用令人敬畏的Requests库.我找到了urllib3的补丁,它请求依赖,与App Engine兼容.https://github.com/shazow/urllib3/issues/61

我能成功

import requests
Run Code Online (Sandbox Code Playgroud)

但是之后

response = requests.get('someurl')
Run Code Online (Sandbox Code Playgroud)

以下回溯失败.这是怎么回事?

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/__init__.py", line 317, in post
    exec(compiled_code, globals())
  File "<string>", line 6, in <module>
  File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py", line 52, in get
    return request('get', url, **kwargs)
  File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py", line 40, in request
    return s.request(method=method, url=url, **kwargs)
  File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/sessions.py", line 208, in request
    r.send(prefetch=prefetch)
  File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/models.py", line 458, in send
    self.auth = get_netrc_auth(url)
  File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/utils.py", line 43, in get_netrc_auth
    for loc in locations:
  File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/utils.py", …
Run Code Online (Sandbox Code Playgroud)

google-app-engine urllib3 python-requests

24
推荐指数
3
解决办法
1万
查看次数

python请求不使用谷歌应用程序引擎

我正在尝试使用以下代码的python请求获取页面views.py:

s = requests.Session()
r = s.get("https://www.23andme.com/")
Run Code Online (Sandbox Code Playgroud)

我收到错误Exceeded 30 redirects.我的应用程序是Google App Engine Django应用程序.我已经将此代码用于python控制台和pythonanywhere.com上的django服务器,但由于某种原因它不适用于谷歌应用引擎.可能是什么导致了这个?谢谢

编辑:似乎我的应用程序中的"请求"模块存在另一个问题.我有这个代码将电子邮件添加到mailchimp列表:

m = mailchimp.Mailchimp(MAILCHIMP_API_KEY)
list_response = m.lists.list()
Run Code Online (Sandbox Code Playgroud)

但如果因错误而失败 HTTPS/SSL is required

python django google-app-engine python-requests

6
推荐指数
2
解决办法
1928
查看次数