password = request.DATA.get('p')
user = authenticate(username=username, password=password)
if user is not None:
    login(request, user)
return redirect('/')
CSRF Exempt Failure - APIView csrf django rest framework