title: Django 'NoneType' object has no attribute 'has_header' when subclass LoginView
body: <p>I want to try a custom login on django and want to process some form data before login. I went out to this:</p>
  
  <pre><code>class mylogin(auth_views.LoginView):
      def form_valid(self, form):
          print("datas :D!", form.cleaned_data['password'])
          super().form_valid(form)
  </code></pre>
  
  <p>All the other things should remain the ones of the LoginView.
  So, in my urls.py I have:</p>
  
  <pre><code>path('login/', views.mylogin.as_view(template_name='public/login.html'), name='login'),
  </code></pre>
  
  <p>Error, when i try to log in is:</p>
  
  <pre><code>AttributeError: 'NoneType' object has no attribute 'has_header'
  </code></pre>