1👍
✅
'user': str(request.user)
this would fetch the user object and call __str__
method
@api_view(['GET'])
@authentication_classes([JWTAuthentication])
def GetUser(request, format=None):
user = request.user
content = {
'id': user.id,
'email': user.email,
'first_name': user.first_name,
# other_fields
'auth': str(request.auth)
}
return Response(content)
Source:stackexchange.com