Where you make your connection to the database add the following.
conn = sqlite3.connect('your.db', check_same_thread=False)
Where you make your connection to the database add the following.
conn = sqlite3.connect('your.db', check_same_thread=False)