[英]Django ImportError: Module “social_core.backends.google” does not define a “GoogleOpenId” attribute/class
I've cloned my working Django app into a Debian based Linux distribution, I've installed all dependencies, but when trying to login with email and password or with Google account it throws me the following error: I've cloned my working Django app into a Debian based Linux distribution, I've installed all dependencies, but when trying to login with email and password or with Google account it throws me the following error:
ImportError: Module "social_core.backends.google" does not define a "GoogleOpenId" attribute/class
I have the following dependencies for authentication:我有以下身份验证依赖项:
django-allauth==0.42.0
django-rest-auth==0.9.5
google-auth==1.27.0
oauthlib==3.1.0
requests-oauthlib==1.3.0
social-auth-app-django==3.1.0
social-auth-core==4.0.3
It was working well in Ubuntu and MacOs, the problem appeared when cloning to this Debian Based Distro.它在 Ubuntu 和 MacOs 中运行良好,克隆到这个基于 Debian 的发行版时出现了问题。 Google says nothing about this error and I don't know where to start searching, the only thing I've found is that we are using it as an Authentication backend:谷歌对这个错误只字未提,我不知道从哪里开始搜索,我唯一发现的是我们将它用作身份验证后端:
AUTHENTICATION_BACKENDS = (
'social_core.backends.open_id.OpenIdAuth',
'social_core.backends.google.GoogleOpenId',
'django.contrib.auth.backends.ModelBackend'
)
Thanks to the comment explaining the python-social-auth deprecation, Ive solved the issue by downgrading social-auth-core
package from version 4.0.3
to 3.3.3
:感谢解释 python-social-auth 弃用的评论,我通过将social-auth-core
package 从版本4.0.3
降级到3.3.3
解决了这个问题:
GoogleOpenID is no longer in use, so it was removed from python-social-auth. GoogleOpenID 不再使用,因此已从 python-social-auth 中删除。 But they must have forgotten to update the docs.但他们一定忘记更新文档了。
https://github.com/python-social-auth/social-core/issues/472https://github.com/python-social-auth/social-core/issues/472
https://github.com/python-social-auth/social-docs/issues/65 https://github.com/python-social-auth/social-docs/issues/65
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.