简体   繁体   English

Django ImportError:模块“social_core.backends.google”未定义“GoogleOpenId”属性/类

[英]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.

相关问题 Django ImportError:模块未定义属性/类 - Django ImportError: Module does not define attribute/class "模块“django.core.mail.backends.console”未定义“EmailBacked”属性\/类" - Module "django.core.mail.backends.console" does not define a "EmailBacked" attribute/class 如何解决导入错误:模块“django.middleware.csrf”未定义“Cs‚rfViewMiddleware”属性/类 - How to solve an ImportError: Module "django.middleware.csrf" does not define a "Cs‚rfViewMiddleware" attribute/class 模块“oscar.apps.customer.auth_backends”未定义“EmailBackend”属性/类 - Module “oscar.apps.customer.auth_backends” does not define a “EmailBackend” attribute/class 异常值:模块“storages.backends.gcloud”未定义“GoogleCloudMediaStorage”属性/类 - Exception Value: Module “storages.backends.gcloud” does not define a “GoogleCloudMediaStorage” attribute/class / 模块“cart.context”处的 ImportError 未定义“cart_context”属性/类 - ImportError at / Module "cart.context" does not define a "cart_context" attribute/class importError:没有名为“ django.db.backends.util”的模块 - importError: No module named 'django.db.backends.util' DJANGO:没有名为 social_auth.backends.contrib.github 的模块 - DJANGO: No module named social_auth.backends.contrib.github django管理员加载错误:/ admin / login /的ImportError /没有名为后端的模块 - django admin load error: ImportError at /admin/login/ No module named backends ImportError:没有名为“ social_django”的模块 - ImportError: No module named 'social_django'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM