title: How to create sign up form(ModelForm) using meta class as django.contrib.auth.models.User?
body: <p>I want to create a sign up form and create a User(model).</p>
  
  <p>I am very new to django and I cannot figure out how to do so.
  I have written this but this doesn't seem to work well.</p>
  
  <pre><code>class SignUpForm(forms.ModelForm):
      confirm_password = forms.CharField(max_length=50)
  
      class Meta:
          model = User
          fields = ['password', 'email', 'first_name', 'last_name']
  
      def is_valid(self):
          if super(SignUpForm, self).is_valid() and  self.confirm_password == self.instance.password:
               return True
          else:
              False
  
      def save(self, commit=True):
          if self.is_valid():
              self.instance.objects.create_user(username=self.instance.email, email=self.instance.email,
                                            password=self.instance.password, first_name=self.instance.first_name,
                                            last_name=self.instance.last_name).save()
  </code></pre>
  
  <p>When I try to access <code>confirm_password</code> it throws AttributeError 
  <code>AttributeError: 'SignUpForm' object has no attribute 'confirm_password'</code></p>
  
  <p>And more-over when I am trying to accesss the other attributes of the meta class like <code>password</code> , <code>email</code>, <code>first_name</code> and <code>last_name</code> using <code>self.instance</code> attribute it always returns a null string <code>''</code>. Can anyone please tell me the correct and an efficient method to create a sign up model form. 
  Thank you. </p>