reverse engineer mysql database to create django app

最后都变了- 提交于 2019-11-27 05:28:12

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/1545714/reverse-engineer-mysql-database-to-create-django-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!