In my app I need the user to use their email and password to login. Using allauth It creates a registration form where the email field is optional and there is a username field.
I want my registration to have three fields:
I have tried creating a custom form but it's not working for some reason. I don't know how I can remove the username from the form.
class SignupForm(forms.Form):
email = forms.EmailField(label='Email', required=True)
class Meta:
model = get_user_model()
def save(self, user):
user.email = self.cleaned_data['email']
user.save()
It just needs to allow me to register the user correctly and then I can handle the rest
The solution to this was simple, it was just a configuration issue. I added these into the settings file:
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = True
ACCOUNT_SIGNUP_FORM_CLASS = 'accounts.forms.SignupForm'