class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
serializer_class = UserSerializer

def get_object(self):
    pk = self.kwargs.get('pk')
if pk == 'current':
    return self.request.user
return super(UserViewSet, self).get_object()
Return the current user with Django Rest Framework