Hi guys! Can someone help me to figure out what am I doing wrong?
I have profiles.forms.ExtraDataSignupForm:
from django import forms
class ExtraDataSignupForm(forms.Form):
country = forms.CharField(required=False)
about = forms.CharField(required=False)
NB I know about required signup method, I'm not defining it to catch an exception about it.
In my settings.py I have:
ACCOUNT_SIGNUP_FORM_CLASS = 'profiles.forms.ExtraDataSignupForm'
And on running project I'm getting django.core.exceptions.ImproperlyConfigured:
django.core.exceptions.ImproperlyConfigured: Module "profiles.forms" does not define a "ExtraDataSignupForm" class
If I comment ACCOUNT_SIGNUP_FORM_CLASS in settings and try from shell:
In [1]: from importlib import import_module
In [2]: f = import_module('profiles.forms')
In [3]: c = getattr(f, 'ExtraDataSignupForm')
In [4]: c
Out[4]: profiles.forms.ExtraDataSignupForm
Everything importing fine without errors.
What am I doing wrong? Could anyone help me?
Thanks!
UPDATE
Seems the problem is because I have also inherited from SignupForm and other custom forms for login, password reset and others.
BTW is there a way to implement ACCOUNT_FORMS and ACCOUNT_SIGNUP_FORM_CLASS in the same time?
So, for those who would suffer with the same issue:
The issue occurs if you have customized SignupForm with ACCOUNT_FORMS and extended the signup form with ACCOUNT_SIGNUP_FORM_CLASS. Make sure your custom SignupForm and your form for extension defined in different files.
In my case, I had them in the one file profiles.forms and there was a cycling import (I guess). I've moved my ExtraDataSignupForm to separate file and point to in in ACCOUNT_SIGNUP_FORM_CLASS, everything works like a charm.
Good luck!
I have no clue of what you did. For me it's not working. I know it's been a while but do you remember what you did?
Most helpful comment
So, for those who would suffer with the same issue:
The issue occurs if you have customized
SignupFormwithACCOUNT_FORMSand extended the signup form withACCOUNT_SIGNUP_FORM_CLASS. Make sure your customSignupFormand your form for extension defined in different files.In my case, I had them in the one file
profiles.formsand there was a cycling import (I guess). I've moved myExtraDataSignupFormto separate file and point to in inACCOUNT_SIGNUP_FORM_CLASS, everything works like a charm.Good luck!