使用SQLite创建SQLAlchemy query.all()

2024-05-29 02:44:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我遵循本教程microblog来实现一个web应用程序。 我被困在“游戏时间”一段。 当我在python控制台中运行此命令时users = User.query.all()

我的编辑器Pycharm返回此错误

sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 12404 and this is thread id 7880.
[SQL: SELECT user.id AS user_id, user.username AS user_username, user.email AS user_email, user.password_hash AS user_password_hash 
FROM user]
[parameters: [immutabledict({})]]
(Background on this error at: http://sqlalche.me/e/13/f405)

我怎样才能解决这个问题


Tags: inwebidemailasusername教程password

热门问题