I couldn’t find a way to display the custom required custom fields on the "Add New Custom Page" page of the administrator.
I created a user user that extends AbstractUser and added three required custom fields. I did not create a custom UserManager because I am expanding from AbstractUser not AbstractBaseUser.
For the administrator: 1. I created a custom UserCreationForm, expanding it. Inside the metaclass, I added these three new custom fields
But I can not see user fields on the admin side. Am I doing smt wrong?
Here is the code for admin:
class MyUserCreationForm(UserCreationForm): """A form for creating new users. Includes all the required fields, plus a repeated password.""" password1 = forms.CharField(label='Password', widget=forms.PasswordInput) password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput) class Meta: model = get_user_model() fields = ('customField1', 'customField2', 'customField3',) def clean_password2(self):
source share