I am trying to configure a custom user using django-allauth and have created the following signup form in a new app customforms
#settings.py
ACCOUNT_SIGNUP_FORM_CLASS = 'custom_forms.SignupForm'
#custom_forms/models.py
from django import forms
from django.contrib.auth import get_user_model
class SignupForm(forms.Form):
first_name = forms.CharField(max_length=30, label='Voornaam')
last_name = forms.CharField(max_length=30, label='Achternaam')
bio= forms.CharField(max_length=500)
email = forms.EmailField(max_length=254)
password=forms.CharField(label=("Password"), widget=forms.PasswordInput)
password_confirm=forms.CharField(widget=forms.PasswordInput)
class Meta:
model = get_user_model()
def save(self, user):
user.first_name = self.cleaned_data['first_name']
user.last_name = self.cleaned_data['last_name']
user.bio= self.cleaned_data['bio']
user.email= self.clean_data['email']
user.save()
I am currently getting the following error: Module "custom_forms" does not define a "SignupForm" class. when I change the path to myapp.custom_forms.SignupForm I get: Error importing form class toteachhisown.custom_forms: "No module named custom_forms". Any ideas/help is much appreciated.