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

后端 未结 6 420
挽巷
挽巷 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:43

    Where you make your connection to the database add the following.

    conn = sqlite3.connect('your.db', check_same_thread=False)
    

提交回复
热议问题