flask自动根据数据库创建ORM model模型

使用 flask-sqlacodegen 扩展 方便快速生成 ORM model 

1

pip install flask-sqlacodegen

 在你的项目app目录下执行,自动根据数据库给我们创建  ORM model

1

flask-sqlacodegen 'mysql://root:[email protected]/food_db' --tables user --outfile "common/models/User.py"  --flask

你可能感兴趣的:(python,flask)