[Django]-Using a registration form to add to custom user fields (django)

3👍

You are saving User only user.save() so other Profile ( please change your user table to something meaningful Profile.

And also you don’t need password first_name last_name email in your profile as well.

And I’ll suggest to use the ModelForm to save the Profile table.

user_form = CreateAccountForm(request.POST)
profile_form = ProfileForm(request.POST)    

if user_form.is_valid() and profile_form.is_valid():  
    # save the form after your password check
    user_form.save()
    profile_form.save()

Leave a comment