参考文档
https://www.jb51.net/article/174365.htm
https://gist.github.com/trustrachel/6828122#file-routing-py
步骤
在配置中添加以下配置
SQLALCHEMY_DATABASE_URI = 'xxx'
SQLALCHEMY_BINDS = {
'xxx',
'xxx',
}
改写session
from flask_sqlalchemy import SQLAlchemy, get_state
import sqlalchemy.orm as orm
from functools import partial
import logging
log = logging.getLogger(__name__)
class AutoRouteSession(orm.Session):
def __init__(self, db, autocommit=False