1👍
✅
One option is to construct the desired output in the view. For example
from rest_framework.response import Response
def view(request):
...
serializer = TrgJobSerializer(DEV, many=True)
response = {'trgjob': serializer.data}
return Response(response)
The JSONRenderer will still handle rendering to JSON, e.g. converting False
to false
etc.
Source:stackexchange.com