1👍
✅
You can call dumpdata
in your view with call_command
(docs here: https://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code).
See this answer: How to use call_command with dumpdata command to save json to file
👤Don
Source:stackexchange.com