I am using django as my backend and I am using restful api to communicate with react js frontend. I have created a pdf invoice with canvas and I was able to send it via mail system of django. But I also want to show the pdf on web page. So I need to send it to front end via api url. I tried to send it as response but I got the error: Object of type Canvas is not JSON serializable
The code that I wrote to send pdf: return Response(c, status=status.HTTP_200_OK)
c stands for the canvas object which is a pdf
Is there a solution of this? Or how do I send the pdf to the front end. Thank you