Django-allauth:社交帐户的自订注册表单 [英] Django-allauth: custom signup form for socialaccount

查看:276
本文介绍了Django-allauth:社交帐户的自订注册表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个问题中找到了和文档),可以使用ACCOUNT_SIGNUP_FORM_CLASS定义帐户注册期间显示的一些自定义表单字段。但是,这种形式似乎并没有出现在使用社交帐户的流程中(至少不是默认情况下)。

I have found in this question (and the doc) that one can use ACCOUNT_SIGNUP_FORM_CLASS to define some custom form field presented during account registration. However, this form does not seem to appear in the flow of using a social account (at least not by default).

有没有办法,容易定制一些处理程序,以便我可以介绍这样的步骤?否则,这会给一个相当不统一的注册过程(使用社交账户的人员将不得不在某些设置屏幕中填写信息,而不是仅仅被问到一次)。

Is there a way to have it, or to easily customize some handlers so that I could introduce such step ? Otherwise, this would give a quite non-unified signup process (people using social accounts would have to go and fill the information afterwards in some settings screen, rather than just being asked it once).

推荐答案

到目前为止,您可以定义 SOCIALACCOUNT_FORMS 设置您自己的自定义社交注册表单:

As of now you can defined SOCIALACCOUNT_FORMS in your settings to set your own custom social signup form:

SOCIALACCOUNT_FORMS = {
    'signup': 'myproject.myapp.forms.CustomSocialSignupForm'
}

这篇关于Django-allauth:社交帐户的自订注册表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆