title: "This field is required" keeps showing even all the input field is filled
body: <p>Please help. The signup page keeps showing this field is required error. I'm a beginner. thankyouu</p>
  <p><strong>models.py</strong></p>
  <p>from django.db import models</p>
  <p>from django.contrib.auth.models import AbstractBaseUser, BaseUserManager</p>
  <p>class UserManager(BaseUserManager):</p>
  <pre><code>def create_user(self, email, username, full_name, password=None):
      if not email:
          raise ValueError(&quot;Users must have an email adress&quot;)
      if not username:
          raise ValueError(&quot;Users must have a username&quot;)
      if not password:
          raise ValueError(&quot;Users must have a password&quot;)
      if not full_name:
          raise ValueError(&quot;Users must have a name&quot;)
      user = self.model(
          email=self.normalize_email(email), # return lowercase
          username=username,
          full_name=full_name,
      )
      user.set_password(password) # users set password and change password
      user.full_name = full_name
      user.save(using=self._db)# using the default database in settings.py
      return user
  
  def create_superuser(self, email, username, full_name, password=None):
      user = self.create_user(
          email=self.normalize_email(email),  # return lowercase
          username=username,
          full_name=full_name,
          password=password,
      )
      user.is_admin = True
      user.is_staff = True
      user.is_superuser = True
      user.save(using=self._db)  # using the default database in settings.py
      return user
  </code></pre>
  <p>class Account(AbstractBaseUser):</p>
  <pre><code>email               = models.EmailField(
      verbose_name=&quot;email&quot;,
      max_length=60,
      unique=True,
  )
  username            = models.CharField(max_length=30, unique=True)
  full_name           = models.CharField(max_length=30, blank=True, null=True)
  date_joined         = models.DateTimeField(verbose_name='date joined', auto_now_add=True)
  last_login          = models.DateTimeField(verbose_name='last login', auto_now=True)
  is_admin            = models.BooleanField(default=False)
  is_active           = models.BooleanField(default=True)
  is_staff            = models.BooleanField(default=False)
  is_superuser        = models.BooleanField(default=False)
  profile_image       = models.ImageField(max_length=255, null=True, blank=True, default=default_profile)
  hide_email          = models.BooleanField(default=True)
  
  USERNAME_FIELD = &quot;email&quot;
  REQUIRED_FIELDS = [&quot;username&quot;, &quot;full_name&quot;]
  
  objects = UserManager()   # tie account to my custom user manager
  
  def __str__(self):
      return self.username
  
  # &quot;Does the user have a specific permission?&quot;
  def has_perm(self, perm, obj=None):
      return True
  
  # &quot;Does the user have permissions to view the app `app_label`?&quot;
  def has_module_perms(self, app_label):
      return True
  </code></pre>
  <p><strong>views.py</strong></p>
  <p>from django.shortcuts import render, redirect</p>
  <p>from django.contrib.auth import login, logout, authenticate</p>
  <p>from account.forms import RegistrationForm, AccountAuthenticationForm</p>
  <p>def register_view(request):</p>
  <pre><code>user = request.user
  if user.is_authenticated:
      return redirect('home')
  if request.method == 'POST':
      form = RegistrationForm(request.POST)
      if form.is_valid():
          form.save()
          email = form.cleaned_data.get('email').lower()
          raw_password = form.cleaned_data.get('password1')
          user = authenticate(email=email, password=raw_password)
          login(request, user)
          return redirect('home')
  else:
      form = RegistrationForm()
  return render(request, 'account/register.html', {'registration_form': form})
  </code></pre>
  <p>def login_view(request):</p>
  <pre><code>context = {}
  
  user = request.user
  if user.is_authenticated:
      return redirect(&quot;home&quot;)
  
  if request.POST:
      form = AccountAuthenticationForm(request.POST)
      if form.is_valid():
          email = request.POST.get('email')
          password = request.POST.get('password')
          user = authenticate(request, email=email, password=password)
          if user is not None:
              login(request, user)
              return redirect(&quot;home&quot;)
  else:
      form = AccountAuthenticationForm()
      context['login_form'] = form
  return render(request, &quot;account/login.html&quot;, context)
  </code></pre>
  <p>def logout_view(request):
  logout(request)
  return redirect(&quot;home&quot;)</p>
  <p><strong><code>forms.py</code></strong></p>
  <p>from django import forms</p>
  <p>from django.contrib.auth import get_user_model</p>
  <p>from .models import Account</p>
  <p>from django.contrib.auth import authenticate</p>
  <p>User = get_user_model()</p>
  <p>class RegistrationForm(forms.ModelForm):</p>
  <pre><code>full_name   = forms.CharField()
  email       = forms.EmailField(max_length=60, help_text='Required. Add a valid email address.')
  password1   = forms.CharField(widget=forms.PasswordInput)
  password2   = forms.CharField(widget=forms.PasswordInput, label='Confirm password')
  
  
  class Meta:
      model = Account
      fields = (
          'email',
          'username',
          'full_name',
          'password1',
          'password2',
      )
  
  def save(self, commit=True):
      user = super(RegistrationForm, self).save(commit=False)
      user.email = self.cleaned_data.get('email')
      user.username = self.cleaned_data.get('username')
      user.full_name = self.cleaned_data.get('full_name')
      if commit:
          user.save()
      return user
  
  def clean_email(self):
      email = self.cleaned_data.get('email')
      qs = User.objects.filter(email=email)
      if qs.exists():
          raise forms.ValidationError(f&quot;Email {email} is already taken&quot;)
      return email
  
  def clean_username(self):
      username = self.cleaned_data.get('username')
      qs = User.objects.filter(username=username)
      if qs.exists():
          raise forms.ValidationError(f&quot;Username {username} is already taken&quot;)
      return username
  
  def clean(self):
      data = self.cleaned_data
      password1 = self.cleaned_data.get('password1')
      password2 = self.cleaned_data.get('password2')
      if password2 != password1:
          raise forms.ValidationError(&quot;Passwords must match&quot;)
      return data
  </code></pre>
  <p>class AccountAuthenticationForm(forms.ModelForm):</p>
  <pre><code>password = forms.CharField(label='Password', widget=forms.PasswordInput)
  
  class Meta:
      model = Account
      fields = ('email', 'password')
  
  def clean(self):
      if self.is_valid():
          email = self.cleaned_data.get('email')
          password = self.cleaned_data.get('password')
      if not authenticate(email=email, password=password):
          raise forms.ValidationError(&quot;Incorrect username or password&quot;)
  </code></pre>