I always get None value from authenticate function through I have registered user when testing by using Postman and I also try using Django Shell.
@csrf_exempt
def test_login(request: HttpRequest):
if request.method == "POST":
data = request.POST
username = data.get('username', None)
password = data.get('password', None)
user = authenticate(request,username=username,password=password)
print(user)
if user:
return JsonResponse(data={"message":"User Found"})
return JsonResponse(data={"message":"User Not Found"})
here is when I test in Django Shell
I have followed to Django tutorial Authenticating users, everything work fine but when I go to Rest Framework, it’s not working anymore. Please help me.