Data for Question and Choices only (no Votes)
python manage.py dumpdata --indent=2 -o data/polls-v4.json polls.question polls.choice
Data for Votes
`python manage.py dumpdata --indent=2 -o data/votes-v4.json polls.vote
The auth.user data in a file data/users.json
python manage.py dumpdata --indent=2 -o data/users.json auth.user
Be careful: if you dump all data from the auth app (not just auth.user), there may be conflicts when you import the data. This is because migrations add some data to the auth database tables.
By separating the Question and Choice data from other data, someone can install a “clean” polls app with your questions but without any users or votes.
You can load data files 1-by-1 or all 3 files in one command:
For this release create 3 data files.
python manage.py dumpdata --indent=2 -o data/polls-v4.json polls.question polls.choice
`python manage.py dumpdata --indent=2 -o data/votes-v4.json polls.vote
python manage.py dumpdata --indent=2 -o data/users.json auth.user
Be careful: if you dump all data from the auth app (not just auth.user), there may be conflicts when you import the data. This is because migrations add some data to the auth database tables.By separating the Question and Choice data from other data, someone can install a “clean” polls app with your questions but without any users or votes.
You can load data files 1-by-1 or all 3 files in one command:
python manage.py loaddata data/polls-v4.json data/votes-v4.json