I am trying to make a get request with an ID argument in django as the doc says in https://docs.djangoproject.com/en/3.2/topics/class-based-views/ but I can't seem to make it work.
The request is arriving in the backend as expected.
"GET /api/acordo-parcela/1/ HTTP/1.1" 200 348
where 1 is my ID.
but even after creating a new urlpattern it does not reach the view class
The urlpattern: path('/acordo-parcela/<int:clienteId>/', GetParcelas.as_view()),
The GetParcelas class:
class GetParcelas(APIView):
print("test")
def get(self, request, clienteId):
print("inside")
return Response(clienteId)
I have read the docs on https://docs.djangoproject.com/en/3.2/topics/http/urls/ and tried with views.AcordoParcelaViewSet (a viewset I created accordingly) but keep getting a 'has no attribute' error. What is the easyer way to make this get request with an argument?