2👍
✅
call_command
does not accept shell commands, only django admin ones.
Instead use this:
import sys
sys.stdout = open('backup.json', 'w')
call_command('dumpdata')
👤Udi
Source:stackexchange.com