我只想允许用户使用他们的社交账户进行注册或登录。我已经实现了社交账户的注册和登录功能,但是我不知道如何禁用本地注册。
我已经阅读了文档,但这似乎与我想要的不太一样。
ACCOUNT_FORMS (={})
Used to override forms, for example: {‘login’: ‘myapp.forms.LoginForm’}
看起来我可以创建一个新的注册表单,只包括社交登录链接,但我希望还有更简单的方法,可能我错过了什么。我还是新手,所以经常会忽略一些显而易见的东西。
我也尝试将下面的代码更改为False,但这样会禁用社交注册。
allauth.account.adapter.py
def is_open_for_signup(self, request):
"""
Checks whether or not the site is open for signups.
Next to simply returning True/False you can also intervene the
regular flow by raising an ImmediateHttpResponse
"""
return True