使用Django的注册和Django-allauth登录 [英] Using Django's registration and login with Django-allauth
问题描述
我一直在尝试向我的应用添加功能,以便用户可以将他们在我的网站上创建的帖子推送到Facebook,Twitter和G +个人资料中.
I've been trying to add a functionality to my app, so that uses can push the posts they create on my website to there Facebook, Twitter and G+ profiles.
因此,我认为 django-allauth 是解决问题的好方法.但是我想要的是用户使用Django的身份验证后端进行注册和登录,一旦他们进入系统,他们就可以选择链接其FB,Twitter和G +个人资料.
So I decided django-allauth can be a good way to go about it. But what I want is users to Register and Login using Django's Authentication backend and once they are in the system then they can choose to Link their FB, Twitter and G+ profiles.
是否可以使用django-allauth实现这种功能?
Is there a way to achieve this kind of functionality using django-allauth?
推荐答案
鉴于上面的评论讨论,您最初的问题不是您真正想要的.
Given our comment discussion above, your original question was not what you were really after.
如果其他人有兴趣,仍可以为该原始问题提供答案: allauth
现在(*)支持 is_open_for_signup(self,request,sociallogin)
方法,该方法可以您可以覆盖.它位于DefaultSocialAccountAdapter上.只需在此处返回false即可禁用社交注册.
Still to provide an answer to that original question, provided someone else is interested: allauth
now (*) supports an is_open_for_signup(self, request, sociallogin)
method that you can override. It lives on the DefaultSocialAccountAdapter. Simply return false here to disable social signups.
(*),因为 https://github.com/pennersr/django-allauth/提交/6794afedcdeaafa907f1184772371f44e742514f
这篇关于使用Django的注册和Django-allauth登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!