[Django]-Django got an unexpected keyword argument 'id'

46👍

Your parameter ?P<id> in the URL mapping has to match the arguments in the view def person_detail(request, person):

They should both be id or both person.

11👍

You should fix the view and use the id argument name instead of person:

def person_detail(request, id):
👤alecxe

0👍

My mistake was I only added the first parameter instead of both,i.e I mentioned def person_detail(request) instead of def person_detail(request,id)

Leave a comment