Django use fixtures as data output/input format. Here is an example:
[Method to Export models from Django:
{
"pk": 2,
"model": "auth.group",
"fields": {
"name": "APK Reviewer",
"permissions": [22]
}
}
]
python manage.py dumpdata [modelname] > [exportfile.json]You can also use this command to display models schema without database client:
python manage.py sql [modelname]Method to Import models into Django:
python manage.py loaddata --verbosity=2 [importfile.json]
No comments:
Post a Comment