title: object has no attribute 'set_password'
body: <p>I am getting an error message of 'UserProfileInfo' object has no attribute 'set_password'
  I cant seem to find what I missing I did a few projects alike this one but never encountered such error
  Is there something I missing. I have been trying to fix this for the past hour but still no luck I would appreciate it if you help me out</p>
  <pre><code>from django.contrib.auth import authenticate, login, logout
  from django.http import HttpResponse, HttpResponseRedirect
  from django.shortcuts import render
  from django.urls import reverse
  from .forms import UserForm , LoginForm
  
  # Create your views here.
  def home(request):
  
      if not request.user.is_authenticated: 
          message = &quot;You are not logged in&quot;
          return render(request,'home.html',{&quot;MESSAGE&quot;:message})
      else:
          message = &quot;You are logged in&quot;
          return render(request,'home.html',{&quot;MESSAGE&quot;:message})
  
  
  
  def Register(request):
      registered = False
  
      if request.method == 'POST':
          
          user_form = UserForm(data=request.POST)
          
  
          if user_form.is_valid():
  
              user = user_form.save()
  
              user.set_password(user.password)
  
              user.save()
  
              registered = True
  
          else:
             
              print(user_form.errors)
  
      else:
          
          user_form = UserForm()
  
  
      return render(request,'signup.html',
      {'user_form': user_form,'registered':registered})
  
  
  
  
  def user_login(request):
  
      if request.method == 'POST':
  
          login_info = LoginForm(request.POST)
         
  
          if login_info.is_valid():
              user = authenticate(username = login_info.cleaned_data[&quot;username&quot;], password=login_info.cleaned_data[&quot;password&quot;])
  
          
  
              if user:
  
                  login(request,user)
  
  
                  return HttpResponseRedirect(reverse('Home'))
  
              else:
                  return HttpResponse(&quot;Wrong&quot;)
  
      else:
          login_info = LoginForm()
      
      return render(request,&quot;login.html&quot;,{'logininfo':login_info})
  </code></pre>
  <blockquote>
  <p>My form</p>
  </blockquote>
  <pre><code>from cProfile import label
  from re import L
  from django import forms
  from django.contrib.auth.models import User
  from .models import Message,Room
  
  
  class UserForm(forms.ModelForm):
      password = forms.CharField(widget=forms.PasswordInput())
  
      class Meta():
          model = User
          fields = ('username','email','password')
          labels = {
              'username' : ('USERNAME!!')
          }
  
          help_texts = {
              'username' : 'Make It Unique'
          }
  
  class MessageForm(forms.ModelForm):
  
      class Meta():
  
          model = Message
  
          fields = &quot;__all__&quot;
  
  
  class LoginForm(forms.Form):
      username = forms.CharField(label = 'Your username')
      password = forms.CharField(label= &quot;Don't tell any but us&quot;,widget=forms.PasswordInput())
  </code></pre>
  <blockquote>
  <p>Models</p>
  </blockquote>
  <pre><code>from django.db import models
  from datetime import datetime
  from django.contrib.auth.models import User
  
  # Create your models here.
  class Room(models.Model):
      room_name = models.CharField(max_length=250)
  
      def __str__(self):
          return self.room_name
  
  
  class UserProfile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
  
  
      def __str__(self):
          return self.user.username
  
  
  
  
  
  class Message(models.Model):
      userinfo = models.ForeignKey(UserProfile,on_delete=models.CASCADE)
      room = models.ForeignKey(Room, on_delete=models.CASCADE)
  
      message = models.CharField(max_length=250)
      date = models.DateTimeField(default=datetime.now, blank=True)
  
      def __str__(self):
          return self.message
      
  
  
  
      
  
  
  
          
  </code></pre>