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
CodePudding user response:
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