ProgrammingError: SQLite objects created in a thread can only be used in that same thread

后端 未结 6 409
挽巷
挽巷 2020-12-01 04:58

i\'m fairly new to programming. I\'ve tried MySQL before, but now it\'s my first time using SQLite in a python flask website. So maybe I\'m using MySQL syntax instead o

6条回答
  •  一整个雨季
    2020-12-01 05:25

    You can try this:

    engine=create_engine('sqlite:///data.db', echo=True, connect_args={"check_same_thread": False})
    

    It worked for me

提交回复
热议问题