ubernostrum / django-registration

An extensible user-registration app for Django.
BSD 3-Clause "New" or "Revised" License
923 stars 241 forks source link

confused with custom RegistrationForm #209

Closed teethgrinder closed 4 years ago

teethgrinder commented 4 years ago

Hello , I am little confused about RegistrationView form class, I have set my url path('accounts/register/', RegistrationView.as_view( form_class=YogaUserForm, success_url="/" ), name="django_registration_register"),

and form

from yogavidya.apps.profiles.models import User
class YogaUserForm(RegistrationForm):

    class Meta(RegistrationForm.Meta):
        model = User

and now I get an error, could not figure out how to solve this? can you help me ? Thanks.

ImproperlyConfigured at /accounts/register/
You are attempting to use the registration view <class 'django_registration.backends.one_step.views.RegistrationView'>
with the form class <class 'yogavidya.apps.profiles.forms.YogaUserForm'>,
but the model used by that form (<class 'django.contrib.auth.models.User'>) is not
your Django installation's user model (<class 'yogavidya.apps.profiles.models.User'>).

Most often this occurs because you are using a custom user model, but
forgot to specify a custom registration form class for it. Specifying
a custom registration form class is required when using a custom user
model. Please see django-registration's documentation on custom user
models for more details.
mastizada commented 4 years ago

@teethgrinder how did you solved the issue? I'm having the same problem now.