Hi,
I am building authorization in django framework using python.. The problem is that my code is working fine on local server but when I run the same in production it returns "Anonymous User"
Am I doing it right?
if request.user.has_perm('auth.access_admin')
""whole code""
else:
return Response({'error': 'Unauthorized'},
status=status.HTTP_401_UNAUTHORIZED)
My request.user.has_perm return false because request.user is Anonymous.I also try to return my request.user.username it is also coming blank.Please help me out!
Thanks
Akash