No attribute 'set_password' when making a custom User form
<p>so I am trying to make a custom user form for registering and admin thing. The problem is, I try to register someone, and I get the error that there is no attribute 'set_password'. Here is in my views.py:</p>

<pre><code>form = RegistrationForm()
if request.method=="POST":
    if request.POST['action']=="register":
        form = RegistrationForm(request.POST or None)
        if form.is_valid():
            form.save()
</code></pre>

<p>Here is the RegistrationForm() in forms.py:</p>

<pre><code>class RegistrationForm(UserCreationForm):

    fname = forms.CharField(max_length=256, label="", required=True, widget=forms.TextInput(attrs={'class': 'form-control','placeholder': 'First Name','required':True}))
    lname = forms.CharField(max_length=256, label="", required=True, widget=forms.TextInput(attrs={'class': 'form-control','placeholder': 'Last Name','required':True}))
    email = forms.EmailField(max_length=256, label="Email", required=True, widget=forms.EmailInput(attrs={'class': 'form-control','placeholder': 'Email','required':True, 'type':'email'}))
    emailConfirm = forms.EmailField(max_length=256, label="", required=True, widget=forms.EmailInput(attrs={'class': 'form-control','placeholder': 'Confirm Email','required':True, 'type':'email'}))
    password1 = forms.CharField(max_length=256, label="", required=True, widget=forms.PasswordInput(attrs={'class': 'form-control','placeholder': 'Password','required':True}))
    password2 =forms.CharField(required=False)

    biography = forms.CharField(label = "Biography",required=False)
    research_place = forms.CharField(label="Research Place",required=False)
    studies = forms.CharField(label="Studies",required=False)

    class Meta:
        model = RegisterUser
        fields = ('email','emailConfirm','password1','biography','research_place','studies')
    def save(self,commit=True):
        RegisterUser = super(RegistrationForm,self).save(commit=False)
        RegisterUser.first_name=self.cleaned_data['fname']
        RegisterUser.last_name=self.cleaned_data['lname']
        RegisterUser.biography=self.cleaned_data['biography']
        RegisterUser.research_place="Def"
        RegisterUser.studies="Def"
        print (RegisterUser.studies)

        if commit:
            print("hurr")
            RegisterUser.save()
        return RegisterUser
</code></pre>

<p>And my models.py:</p>

<pre><code>class RegisterUser(models.Model):
    user=models.OneToOneField(User,on_delete=models.CASCADE)
    biography = models.CharField(max_length=1000000)
    research_place = models.CharField(max_length=1000000)
    studies = models.CharField(max_length=1000000)
</code></pre>

<p>And finally admin.py:</p>

<pre><code>class RegisterInline(admin.StackedInline):
    model = RegisterUser
    can_delete = False

class UserAdmin(BaseUserAdmin):
    inlines = (RegisterInline, )

admin.site.unregister(User)
admin.site.register(User, UserAdmin)
</code></pre>

<p>please let me know what I am doing wrong, and if there is anything else I should change. Thanks so much!</p>