from django.contrib.auth.forms import UserCreationForm from .models import User class RegistrationForm(UserCreationForm): def __init__(self, *args, **kwargs): kwargs.pop("request") super().__init__(*args, **kwargs) class Meta: model = User fields = ["email", "password1", "password2"]