You just use it like that:
./manage.py dumpdata > data_dump.json
After that action, there will be data_dump.json
file in the directory in which you executed that command.
There are multiple options coming with that, but you probably already know it. The thing you need to know is how to redirect output from standard output into some file: you perform that action by putting >
before file name.
To append something to the file you would use >>
, but since you are dumping the data from Django and the output is most likely JSON, you will not want that (because it will make JSON invalid).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…