Django社交全部验证 - 多重用户类型
我有两个注册页:注册为买方,注册为卖家。
在这两个页面上,我都使用了使用Google和Facebook的正常注册和社交认证。
我已经使用Django all-auth添加了社交认证,但无法获得user_role。
[1] [注册页]:
- 注册后:用户被重定向到家庭页面,并且由于社交身份验证中没有User_role设置,因此无法访问买方或卖方部分。
[2] [与Google注册]:注册后:用户被注册为空白登录。
- 在Google注册后查看主页:
我的任务:是在两个按钮上分配user_type:买家 和卖家。单击按钮将用户重定向到其特定的注册页面,并使用社交认证登录/注册,并在成功的login重定向用户登录到其页面,并显示 django-administration-sistristration-sistration-emer_type AS:
user_type |电子邮件| IS_Active
买家|
卖家| [email  procectived] |错误的
I have two Registration pages: Register as Buyer, Register as Seller.
on both Pages , I've included Normal Registration and social authentication using Google and Facebook.
I've added social authentication using Django all-auth, but cannot get user_role.
[1][Registration Page]:
- after Registration : user is redirected to home page and as there is no user_role set in social authentication , one cannot access Buyer or Seller 's section.
[2][Signup with Google]: After signup : User is registered as Blank Login.
- check home page after Google signup:
MY TASK : Is to assign user_type on both the buttons: Buyer and Seller. on click button redirect user to its particular Registration Page and Login/Signup with Social Authentication and after Successful-Login Redirect User to its Page and show user_type in Django-administration-panel as:
User_type | Email | is_active
Buyer | [email protected] | True
Seller | [email protected] | False
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为所有用户创建配置文件模型,然后为用户提供类似的个人资料。
#models.py
这将在用户创建后运行。
#signals.py
编辑:我不知道您的USER_TYPE字段如何,我认为它是“ user_type”
You can create a profile model for all users and then give the user a profile like this.
#models.py
this will run after the user has created.
#signals.py
edit: I don't know how is your user_type field I assume it is "user_type"