title: custom email authentication backend not working in django 2.1.4
body: <p>I am having trouble in integrating custom authentication backend in <code>django 2.1.4</code> . Following is my code : <br>
   my <code>FMS.authBackend</code> module : </p>
  
  <pre><code>from django.contrib.auth import get_user_model
  from django.contrib.auth.backends import ModelBackend
  
  class authEmailBackend(ModelBackend):
      def authenticate(self, username=None, password=None, **kwargs):
          print("aaaaaaa")
          UserModel = get_user_model()
          try:
              user = UserModel.objects.get(email=username)
          except UserModel.DoesNotExist:
              return None
          else:
              if user.check_password(password):
                  return user
          return None
  </code></pre>
  
  <p>my <code>settings.py</code> : </p>
  
  <pre><code>AUTHENTICATION_BACKENDS = (
                  'FMS.authBackend.authEmailBackend',
                  'django.contrib.auth.backends.ModelBackend',
  
                  )
  </code></pre>
  
  <p>my <code>urls.py</code> :</p>
  
  <pre><code>from django.contrib.auth import views as auth_views
  urlpatterns = [ 
          path('login', my_decos.logout_required(auth_views.LoginView.as_view(template_name = 'register/login.html')),name = 'login')
  ]
  </code></pre>
  
  <p>The above code is not working in my case. Function <code>authenticate</code> in <code>authEmailBackend</code> is never called as nothing printed in console but I print statement in <code>authenticate</code> function.</p>
  
  <p>although the same code was working for <code>django 2.0.8</code>, the only difference then was that the <code>urls.py</code> was : </p>
  
  <pre><code>from django.contrib.auth import views as auth_views
  urlpatterns = [ 
          path('login', my_decos.logout_required(auth_views.login(template_name = 'register/login.html')),name = 'login')
  ]
  </code></pre>
  
  <p>but in the newer django the <code>django.contrib.auth.views.login</code> doesn't support any more and we need to use <code>django.contrib.auth.views.LoginView</code>. I read somewhere that to use custom <code>AUTHENTICATION_BACKEND</code> our url must point to <code>django.contrib.auth.views.login</code> but which is not possible here.</p>
  
  <p>So can you please help me to overcome the problem.</p>