Django "get() got an unexpected keyword argument 'pk'" error

The function is getting one argument more than it is supposed to. Change it to:

def get(self, request, pk):

The value of pk will be equal to the pattern that has been matched, and since you've specified that it's going to be a number, the type of pk will be int.


add the kwargs into the method definition:

def get(self, request, *args, **kwargs):
    return HttpResponse("Created :)")