In my Config class, I want to set the check_same_thread to False as below (to avoid the error: sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread. .....)
class Config(object):
#------#
SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db?check_same_thread=False'
#------#
However, in setting up my Config class of the Flask app, I followed Miguel Grinberg's Flask Mega-tutorial and set up the SQLAlchemy database as follows:
class Config(object):
#------#
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///'+os.path.join(basedir, 'app.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
#------#
How do I integrate the set the check_same_thread to False in the above case? Any help or guidance would be highly appreciated.
Thanks!