加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

flask开发中遇到sqlalchemy.exc.OperationalError:(sqlite3.Oper

发布时间:2020-12-17 17:02:56 所属栏目:Python 来源:网络整理
导读:flask开发中遇到sqlalchemy.exc.OperationalError:(sqlite3.OperationalError) no such table: posts [SQL: 'SELECT posts.id AS posts_id,posts.body AS posts_body,posts.timestamp AS posts_timestamp,posts.author_id AS posts_author_id FROM posts ORD

flask开发中遇到sqlalchemy.exc.OperationalError:(sqlite3.OperationalError) no such table: posts [SQL: 'SELECT posts.id AS posts_id,posts.body AS posts_body,posts.timestamp AS posts_timestamp,posts.author_id AS posts_author_id FROM posts ORDER BY posts.timestamp DESC']


这句话的意思是posts 这个表格不存在,解决方法查看sqlite是否存在posts表。如果不存在,在pycharm中Terminal中输入一下命令:

from?app?import?db

db.drop_all()
db.create_all()


(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读