反向工程mysql数据库创建django应用程序 [英] reverse engineer mysql database to create django app
问题描述
创建项目,并将您的设置指向您的数据库
然后运行
./ manage.py inspectdb
这将打印出您指向的DB的python模型文件
您可以通过执行类似于
./ manage.py inspectdb> models.py
然后,您可以将文件移动到最合适的位置,并根据需要进行编辑。
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?
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.
这篇关于反向工程mysql数据库创建django应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!