I am trying to implement an signup and login function.
This is my views.py:
here in auth.authenticate
def login(request):
    if request.method  == 'POST':
        f = auth.authenticate(email = request.POST['email'], password = request.POST['password'])
        print(f)
        if f is not None:
            auth.login(request,f)
            return redirect('home')
        else:
            return render(request,'login.html',{'error':'Wrong Username or password'})
    else:
        return render(request, 'login.html')
It always returns None and if I change to user and trying to login with username and password then it works fine it didn't work for email and password.
i.e
 f = auth.authenticate(username= request.POST['username'], password = request.POST['password'])
I have tried request.get.POST('email') but not working, and I have also checked request.POST['email'] and request.POST['password'] contains valid info.
 
    