How to solve .accepted_renderer not set on Response Error on POST Request, Django

360 Views Asked by At

got a problem when trying to call request using Postman, on POST request always get

AssertionError at /v1/facility/33/court/ .accepted_renderer not set on Response Request Method: POST Request URL:

On Get request other endpoints works fine. Django version - 3.2.15

Class that responsible for this endpoint already have APIView class

class ItemAPIView(
CSRFEnabledApiViewMixin, CreateAPIView, RetrieveUpdateDestroyAPIView):

Even If I put APIView class as last nested class it not working.

Who can help with this? what is wrong?

Note: if I will doing curl request to such endpoint POST - error is the same

1

There are 1 best solutions below

0
Maxim Danilov On

accepted_renderer` is an attribute for request from DjangoRestFramework.

Django itself don't add accepted_renderer to request.

Try to check if you call the DRF-view with Django request.