时间:2021-07-01 10:21:17 帮助过:3人阅读
# 启动文件启动自动触发
from flask import Flask from config.setting import BaseConfig #导入flask-sqlalchemy from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() from .views.user import user # 导入models中的表 from .model.models import * def create_app(): app = Flask(__name__) app.register_blueprint(user) db.init_app(app) return app
执行命令:
初次:
python manage.py db init
python manage.py db migrate
python manage.py db upgrade
flask-sqlalchemy使用命令创建数据库
标签:set manage ase alt com script .com imp 创建