Python社交验证错误

时间:2015-01-12 16:11:51

标签: python django python-social-auth

我正在使用Python Social Auth软件包来使用Google OAuth服务。它在我的本地机器上完美运行。但是,当我在VM linux机器上部署应用程序时,我收到以下错误:

AuthFailed at /complete/google-oauth2/

Authentication failed: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)

Exception Type:     AuthFailed
Exception Value:    Authentication failed: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)
有人可以帮帮我吗?提前谢谢。

1 个答案:

答案 0 :(得分:1)

我最近使用相同的软件包进行测试,但遇到了同样的问题。

如果您使用 { "message": "Other Error", "err": { "storageErrors": [] } } 访问您的服务器,请将其替换为 http://127.0.0.1:8000 后跟您的 URL 路径

Google 需要 HTTPS 请求,因此使用 localhost 将代表开发服务器

这已经为我解决了这个问题。我从这里遇到了这个解决方案 https://youtu.be/wlcCvzOLL8w