50👍
✅
Apparently one of the traps for the unwary is that one must exclude contenttypes when exporting fixtures. (Thanks to subsume on #django for the information).
To exclude content types use the -e
option when running the dumpdata command.
$./manage.py dumpdata -e contenttypes > initial_data.json
11👍
python manage.py dumpdata --exclude=contenttypes --exclude=auth.Permission > initial_data.json
- [Django]-How to use Django 1.8.5 ORM without creating a django project?
- [Django]-Django models filter by foreignkey
- [Django]-How to compare two JSON objects with the same elements in a different order equal?
Source:stackexchange.com