Shreyash mishra
Shreyash mishra

Reputation: 790

how to copy data of a DB from one django app to another app

I have Django app, one is in local machine and other is in production server after deploying in production server i see i lost all my local data lost so I want to know how I can copy all my data from db and paste into production server so is there any way please share how to do it

Upvotes: 3

Views: 1086

Answers (1)

kamran890
kamran890

Reputation: 842

Dump db on local machine:

python3 manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 4 > db.json

Load db on production server:

python3 manage.py loaddata db.json

Upvotes: 4

Related Questions