TypeError: get() got multiple values for argument 'task_id' TypeError: get() got multiple values for argument 'task_id' django django

TypeError: get() got multiple values for argument 'task_id'


The first parameter of get must be request itself. change the

def get(self, task_id):    ...

to this one:

def get(self, request, task_id):     ...


Your get function is wrong. The reason you get the error message is that there aren't enough parameters for the function since it expects a request parameter as well.

Since there's 1 parameter short, the error message occurs because it tries to cramp both request and task_id into the task_id parameter, hence the "multiple values" part of the error message.

This should do the trick.

class TaskStatus(APIView):    def get(self, request, task_id):        return Response({            'result': Huey.result(task_id)        })