title: Django AuthenticationForm is not validating and not storing information in database
body: <p>So basically I'm trying to do a simple login system using Django AuthenticationForm and LoginView. The form takes the user input and when the login button is pressed, the page just reloads, instead of throwing validation errors or logging the user and redirecting him. I've tried to overwrite the clean method but the result is the same. I don't know what I'm doing wrong.</p>
  <p>This is the User model:</p>
  <pre><code>class StoreUser(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):
    email = models.EmailField(
      unique=True,
  )
    date_joined = models.DateTimeField(
      auto_now_add=True,
  )
  
    is_staff = models.BooleanField(
      default=False,
  )
  
    USERNAME_FIELD = 'email'
  
    objects = StoreUserManager()
  </code></pre>
  <p>Here is the Login view:</p>
  <pre><code>class UserLoginView(auth_views.LoginView):
     form_class = UserLoginForm
     template_name = 'store_auth/user_login.html'
     success_url = reverse_lazy('homepage')
  </code></pre>
  <p>And also the Form:</p>
  <pre><code>class UserLoginForm(auth_forms.AuthenticationForm):
     email = forms.EmailField(widget=forms.EmailInput(attrs={'class': 'form-control', 'id': &quot;email-login&quot;, 'placeholder': &quot;Enter your email&quot;,}))
     password = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'form-control', 'id':&quot;password-login&quot;, 'labels': &quot;Password&quot;, 'placeholder': &quot;Enter your password&quot;, }))
  
     class Meta:
      model = StoreUser
  </code></pre>
  <p>And the HTML:</p>
  <pre><code>  &lt;form method=&quot;post&quot; action=&quot;{% url 'user login' %}&quot;&gt;
                {% csrf_token %}
              &lt;div class=&quot;form-group&quot;&gt;
              &lt;label for=&quot;email-login&quot;&gt;E-Mail&lt;/label&gt;
                {{ form.email }}
              &lt;/div&gt;
              &lt;div class=&quot;form-group&quot;&gt;
              &lt;label for=&quot;password-login&quot;&gt;Password&lt;/label&gt;
                {{ form.password }}
              &lt;/div&gt;
              &lt;a href=&quot;javascript:;&quot;&gt;Forgotten Password?&lt;/a&gt;
              &lt;div class=&quot;padding-top-20&quot;&gt;                  
                &lt;button class=&quot;btn btn-primary&quot; type=&quot;submit&quot;&gt;Login&lt;/button&gt;
              &lt;/div&gt;
  </code></pre>
  <p>When the fields are defined through the Meta class everything works fine, and the user is logged in and redirected successfully, but in this way, the field widgets remain unchanged because Meta is parsed by the metaclass before the <strong>init</strong>. I also tried to add the field manually to self. fields:</p>
  <pre><code> def __init__(self, *args, **kwargs):
     super(UserLoginForm, self).__init__(*args, **kwargs)
     self.fields['email'] = forms.EmailField(widget=forms.EmailInput(attrs={'class': 'form-control', 'id': &quot;email-login&quot;, 'placeholder': &quot;Enter your email&quot;,}))
     self.fields['password'] = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'form-control', 'id':&quot;password-login&quot;, 'labels': &quot;Password&quot;, 'placeholder': &quot;Enter your password&quot;, }))
  </code></pre>
  <p>But again and the user is not logged in and the data is not validated. I think my mistake is in the field validation.
  Аny help will be appreciated, thanks in advance!</p>