Local database setting-
`DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}`
main database setting-
`DATABASES = {
'default': {
'ENGINE':'django.db.backends.mysql',
'NAME': '******',
'USER': '******',
'PASSWORD': '********',
'HOST': '******',
'PORT': '****',
}
}`
I did it from the git project
python manage.py dumpdata > all.json . But then I don't know what to do next like how to use this json file to update local database by which commands.
I am very beginner to this. kindly help me solve this problem.
You should always use an RDBMS from the same vendor at both ends. And preferably the same version. Though ORMs such as Django's are supposed to be database agnostic, there are still many subtle differences between different vendor's products. Sqlite for example is the least feature complete of the popular open source databases. If you use sqlite in development, and postgresql in production, you are limiting yourself to the set of features that sqlite has. But postgresql has many more. Right end of sermon.
At the live server do
python manage.py dumpdata > data.json
Then copy the file over to the local machine and do:
python manage.py loaddata data.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With