title: Set non-required fields from django.contrib.auth.User on Django
body: <p>I am trying to create a custom registration form on Django, my Model looks like that:</p>
  
  <pre><code>#models.py
  
  class UserRegister(models.Model):
  
     user = models.ForeignKey(User)
  
     GENDER_CHOICES = (
         ('M', 'Male'),
         ('F', 'Female'),
         ('O', 'Other'),
     )
  
     birthday = models.DateField(null = False, blank=False)
  
     gender = models.CharField(max_length=1, choices=GENDER_CHOICES, null=False)
  </code></pre>
  
  <p>I was reading about models.User and I saw that first_name and last_name are optional and email is not unique. I need that first_name and last_name be required attributes and email be unique in my database, how can I do that?</p>
  
  <p>Thank you.</p>
  
  <p>EDIT 1:
  If I inherit the model from User, my code would be like this?</p>
  
  <pre><code>#models.py
  class UserRegister(User):
      first_name = models.CharField(max_length=30)
      last_name = models.CharField(max_length=30)
      email = models.EmailField(unique=True)
      GENDER_CHOICES = (
          ('M', 'Male'),
          ('F', 'Female'),
          ('O', 'Other'),
      )
      birthday = models.DateField()
      gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
  </code></pre>
  
  <p>EDIT2:
  I solved my problem, what I did was copy <code>AbstractUser</code> from <code>django.contrib.auth.models</code> into my <code>models.py</code> and changed the fields to be required. After that I edited my <code>settings.py</code> adding AUTH_USER_MODEL = 'myApp.MyModelName' to it.</p>
  
  <p>Here is the documentation: <a href="https://docs.djangoproject.com/en/dev/topics/auth/customizing/" rel="nofollow">https://docs.djangoproject.com/en/dev/topics/auth/customizing/</a></p>