django - 如何让 Django 1.5 自定义用户模型和社交身份验证工作?

标签 django django-socialauth django-1.5

据报道,Django Social Auth (0.7.22) 支持自定义用户模型,但我无法让它发挥作用。

就我而言,我使用的是 Google 的 Oauth2,我使用的是非自定义用户模型。

使用自定义用户模型,我可以正确重定向到 Google 帐户页面,选择要登录的帐户,然后重定向到 LOGIN_ERROR_URL,没有消息或调试信息。

为了简化调试,我在 https://github.com/jonathanendersby/SocialAuthCustomUserModel 创建了一个简单的示例项目,其中包含最少的零碎部分。

有没有人让这个工作,他们能指出我哪里出错了吗?

最佳答案

此问题现已在 https://github.com/jonathanendersby/SocialAuthCustomUserModel 的 repo 中得到解决。

报价https://github.com/omab :

The problem was the parameters that create_user() was getting, not all of them are available on all the backends.

By replacing the method signature with the same from django manager, and setting some default values into first_name and last_name fields in your model, it works OK.

关于django - 如何让 Django 1.5 自定义用户模型和社交身份验证工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15391868/

相关文章:

django - 如何使用 django social-auth 在开发环境中使用 facebook 登录?

python - 将 django 从 1.4 更新到 1.5.1;现在 DeprecationWarning on setup_environ

django - 何时在 Django 1.5 中使用自定义用户模型

jquery - 如何在 Django 应用程序中使用 bootstrap-datepicker?

python - 当原始 SQL 不返回时,Django db.connection.cursor.fetchone() 返回空结果

python - 在单元测试中将 kwargs 传递给基于类的 View

python - 不验证用户 django-social-auth?

django - Azure web-app - Django 应用程序的多容器单元未成功启动

Django 社交认证 : what is the best fork?

django - 在 Django 1.5 自定义用户模型中使用电子邮件作为用户名字段会导致 FieldError