[Django]-Django TypeError: get() got multiple values for keyword argument 'invoice_id'

43👍

The first argument (after self) to a view method is always request. The way you’ve defined it, the request is being passed in as the invoice_id method, and the actual invoice_id is being passed in as an additional kwarg, hence the error.

Define your method like this:

def get(self, request, invoice_id, *args, **kwargs):

5👍

You will also get the error if you define your method without self, like:

def get(request, token):

or

def post(request, token):

Like I did once….

Leave a comment