1.出现编码问题
解决方法:
#连接数据库时出现编码问题,需要pip install mysql-connector-python,并且数据库配置修改为 import mysql.connector SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://root:root@localhost:3306/flask_v1?charset=utf8mb4"
2.db.create_all()
在shell中使用db.create_all() 时发现成功创建了db文件,但是里面并没有我要的表。后来网上查了下,需要在shell中 先from app.models import user 才能成功创建表