flask使用sqlalchemy查询数据库,一直返回500

database.py 定义了session

engine = create_engine(settings.DB_URI, echo=True)
Base = declarative_base()
dbsession = scoped_session(sessionmaker(bind=engine))

views中的get.py

@get.route('/quro/<int:qid>')
def get_quro(qid=None):
    data = '123'
    if not qid is None:
        quro_item = dbsession.query(Quro).filter_by(qid=qid).fisrt()
        ...
    ...
    return data

quro_item始终是返回服务器错误500,求大侠们解救

查看回复