I need to write my own APIView class which overrides drf’s APIView and it will have autogenerated self.context which I can pass into serializer.
For example
`class SomeView(APIView):
def post(self, request):
ser = SomeSerializer(data=request.data, context = self.context)
ser.is_valid(raise_exception=True)
return Response(ser.validated_data)
`
New contributor
kwutzee is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.