Migrating Data to Django

We have a requirement to export data from an Oracle database and load exported data into django models. Models in django are created manually based on the same Oracle tables (same names / same columns / same data types). What is the best way to do this? Pls let me know.

Yours faithfully

+4
source share
2 answers
  • Enter your oracle dc credentials and data in settings.py
  • Make ./manage.py inspectdb and create a model file
  • Do ./manage.py dumpdata , which dumps django data from your Oracle database.
  • Now updates its settings with the new database credentials.
  • Then load the data ./manage.py loaddata

Boom.

+2
source

python manage.py loaddata file.type (sql, json, html, csv) to transfer data or import data from an external file into django.

python manage.py dumpdata file.type (sql, json, html, csv) to export data from django to an external file.

-1
source

Source: https://habr.com/ru/post/1338371/


All Articles