I am trying to get the currently logged in user using django restframework and i have written a simple APIView to do this, but when i access the api_view it shows {"detail": "Authentication credentials were not provided."}
, how do i provide the authentication credentials?
How do i provide the authentication details, login and see the user information maybe (username and email)
class MyProfileView(APIView):
permission_classes = [permissions.IsAuthenticated]
def get(self, request):
user = User.objects.get(request.user)
return Response(user.data)