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….
- [Django]-Django Multiple Authentication Backend for one project
- [Django]-Django 1.3.1 compilemessages. Error: sh: msgfmt: command not found
- [Django]-With DEBUG=False, how can I log django exceptions to a log file
Source:stackexchange.com