Modifying Django UserCreationForm

人走茶凉 提交于 2019-11-30 03:59:07
Brandon

You'll need to add the fields you've added to the add_fieldsets property of your custom user admin class.

#example:
add_fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('username', 'email', 'password1', 'password2')}
        ),
    )

A user had a similar question the other day: How can I have Django user registration single step (instead of two step)process with email compulsory? which involved creating a custom user admin form as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!