【问题标题】:How to combine social auth/oauth with django custom user model如何将社交身份验证/oauth 与 django 自定义用户模型相结合
【发布时间】:2021-08-14 22:16:15
【问题描述】:

我有一个基于AbstractBaseUser, PermissionsMixin 的自定义用户模型,我很想使用django-allauth 和/或social-auth-app-django 之类的包。我做了一些研究,但没有找到任何教程或示例。有人可以推荐什么吗?

【问题讨论】:

    标签: django oauth django-allauth social-auth-app-django


    【解决方案1】:

    您需要在 settings.py 中为社交身份验证包设置用户模型。例如:

    SOCIAL_AUTH_USER_MODEL = 'app.YourCustomUser'
    

    在此处了解更多信息:https://python-social-auth.readthedocs.io/en/latest/configuration/settings.html#user-model

    【讨论】:

      猜你喜欢
      • 2014-10-14
      • 2015-08-05
      • 2021-01-19
      • 2013-03-01
      • 2016-11-28
      • 1970-01-01
      • 1970-01-01
      • 2021-01-09
      • 1970-01-01
      相关资源
      最近更新 更多