Comment on Serialize Django Data for JavaScriptparentComments−Chiron19914yDRF is for building REST APIs, but OP wants to dump the JSON-representation of an arbitrary object into an HTML template. That's a very different use case for which simple JSON-encoding and the json_script filter should suffice.
Comments
DRF is for building REST APIs, but OP wants to dump the JSON-representation of an arbitrary object into an HTML template. That's a very different use case for which simple JSON-encoding and the json_script filter should suffice.