InterfaceError (0, '')
This is caused by a global cursor. Try creating and closing the cursor within each method a raw query is needed.
cursor = connection.cursor()
cursor.execute(query)
cursor.close()
You get this error when you have a db.close()
call and later try to access the database without creating a new connection. Try to find if you close the connection to the database when you don't mean to.