manage.py dumpdata --natural will use a more durable representation of foreign keys. In django they are called “natural keys”. For example:
Permission.codenameis used in favour ofPermission.idUser.usernameis used in favour ofUser.id
Read more: natural keys section in “serializing django objects”
Some other useful arguments for dumpdata:
--indent=4make it human readable.-e sessionsexclude session data-e adminexclude history of admin actions on admin site-e contenttypes -e auth.Permissionexclude objects which are recreated automatically from schema every time duringsyncdb. Only use it together with--naturalor else you might end up with badly aligned id numbers.