The above error occurs every time I access my site after about 5 to 30 minutes. I am using Flask and SQLAlchemy. (Secondary question: should I be using ‘Flask-SQLAlchemy’ instead of SQLAlchemy and Flask together? If so, why?) I have my code in two files. The file ‘models.py’ creates the SQLAlchemy engine with the following: engine = create_engine('mysql+mysqldb://user:password@jhyman.mysql.pythonanywhere-services.com', pool_recycle=299, echo=True). I got the value 299 from a post on the forum. My Flask code with the request handlers is in a separate file ‘views.py’. Occasionally, I get a slightly different error message.
I’ve looked at many posts on StackExchange and PythonAnywhere, but have not been able to solve the problem. This is my first time using SQLAlchemy and Flask. Any help would be appreciated. If more information is needed, let me know.