title: Django auth_user_model
body: <p>I'd like to make auth_user_model login but I need to login with Email and Password. So I thought I can do that if I can save email value in 'username' field. </p>
  
  <pre><code>class HeepooUser(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
  
      phone = models.CharField(max_length=15, null=True)
      allow_phone = models.BooleanField(default=False)
      school = models.ForeignKey(School)
      date_join = models.DateTimeField(auto_now_add=True)
  
  
  def register(request):
      registered = False
  
      if request.method == 'POST':
          user_form = UserForm(request.POST)
          profile_form = RegisterForm(request.POST)
  
          if user_form.is_valid() and profile_form.is_valid():
              user = user_form.save(commit=False)
              user.set_password(user.password)
              user = user_form.save()
  
              profile = profile_form.save(commit=False)
              profile.user = user
              profile = profile_form.save()
  
              registered = True
              return HttpResponseRedirect("/books/")
          else:
              return HttpResponse('Wrong access1')
  
      else:
          user_form = UserForm()
          profile_form = RegisterForm()
  
      return render(request, "register.html", {
          'user_form': user_form,
          'profile_form': profile_form,
          'registered': registered,
  })
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>class UserForm(forms.ModelForm):
      email = forms.EmailField(max_length=50, required=True,
                           widget=forms.TextInput(attrs={'class':'form-control', }),
  )
      password = forms.CharField(widget=forms.PasswordInput())
      class Meta:
          model = User
          fields = ('email', 'password',)
  
  
  class RegisterForm(forms.ModelForm):
      class Meta:
          model = HeepooUser
          exclude = ('allow_phone', 'user',)
  </code></pre>
  
  <p>Register.html</p>
  
  <pre><code>    &lt;form action="" method="post"&gt;
          {% csrf_token %}
          {{ user_form.as_p }}
          {{ profile_form.as_p }}
          &lt;input type="submit" value="Register"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Could you please help me on?
  Thanks!</p>