2👍
✅
You give the correct syntax in your first snippet. The argument after dumpdata
is an application, not a file.
If you want to save that output to a file, you use standard redirection:
python manage.py dumpdata myapp > apps/myapp/fixtures/initial_data.json
Source:stackexchange.com