1π
The best way is by using fixtures:
python manage.py dumpdata > application.json
then, after you change your database:
python manage.py loaddata application.json
It should work perfectly, however if you have any trouble try doing the dumpdata
one-by-one for each app like:
python manage.py dumpdata my_app > my_app.json
In some situation it can happen that there are some details that you cannot JSONify some table then you need to --exclude
then into the dumpdata command like:
python manage.py dumpdata my_app --exclude my_app.mymodel > application.json
π€Elias Prado
Source:stackexchange.com