Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reverse engineer mysql database to create django app

I basically want to take an existing mysql database structure created and used by a php app (codeigniter framework) and reverse engineer it to a django app. is there some tool to do this? south migrations maybe?

like image 735
Rasiel Avatar asked Oct 09 '09 19:10

Rasiel


1 Answers

Create a project, and point your settings @ your database

Then run

./manage.py inspectdb

This will print out a python models file for the DB you're pointing at

You can output this to a file by doing something like

./manage.py inspectdb > models.py

And then you can move the file to the most suitable location, and edit it as needed.

like image 97
Mez Avatar answered Oct 02 '22 12:10

Mez