I've made a simple JSON API using django-rest-framework, and I'd like to be able to download the 5 collections as one zipfile containing the collections as JSON files. (my app requires this offline dump of data).
I'm thinking of writing a view, served at, say, /download/
that bundles up the output from all my MyModelList.as_view()
s in a zip and serves it.
What is the best way of doing this? I could use urllib/Requests to query my API directly, but it seems a long way round, to invoke the whole http stack...
Many thanks!