Django create custom UserCreationForm
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I enabled the user auth module in Django, but when I use UserCreationForm he ask me only username and the two password/password confirmation fields. I want also email and fullname fields, and set to required fields. I've done this: from django.contrib.auth.forms import UserCreationForm from django import forms from django.contrib.auth.models import User class RegisterForm(UserCreationForm): email = forms.EmailField(label = "Email") fullname = forms.CharField(label = "Full name") class Meta: model = User fields = ("username", "fullname",