1

I have a sqlite db with some records that I want to import into my Django non-rel db models.

Is the best way just to export the sqlite as a csv and then import the csv?

Something like suggested here: how to import csv data into django models or here: http://djangosnippets.org/snippets/633/

Community
  • 1
  • 1
b-ryce
  • 5,752
  • 7
  • 49
  • 79

1 Answers1

2

You can create a simple (regular) django project and use inspectdb to create the initial models from your sqlite db, then use dumpdata to save it to files. You can later use loaddata in your new project to load it into your models.

If you need further processing, you can create a small script that copies data from the old models to the new models.

Udi
  • 29,222
  • 9
  • 96
  • 129