reference https://docs.djangoproject.com/ja/3.0/ref/django-admin/
mysite
├ mysite
│ ├ settings.py
└ polls
├ admin.py
└ fixtures ← Make here
python manage.py dumpdata polls > polls/fixtures/data.json
python manage.py dumpdata polls.Question > polls/fixtures/Question.json
python manage.py loaddata polls/fixtures/data.json
If you use yaml format, you need PyYAML
, so enter it.
pip install PyYAML
python manage.py dumpdata --format=yaml polls > polls/fixtures/data.yaml
python manage.py loaddata --format=yaml polls/fixtures/data.yaml