Making different registration forms in Django?

Viewed 35

I'm trying to create two different types of users in Django using AbstractUser. I've created two models that inherit from my AbstractUser model.

How do I update the UserCreationForm so that it has a field for user type?

1 Answers

Just override the built-in UserCreationForm and adjust the fields as necessary.

class CustomUserCreationForm(UserCreationForm):
    class Meta:
        model = CustomUser
        fields = UserCreationForm.Meta.fields + ('type',)
Related