cli
cli copied to clipboard
Scheduling jobs that connect to the database
Hello everybody :)
I have followed this tutorial and everything works correctly. I have built the app with Flask and deployed it to heroku with gunicorn.
However, when my scheduler jobs make use of queries to my SQLlite database I obtain the following error in the heroku logs:
RuntimeError: No application found. Either work inside a view function or push an application context. See http://flask-sqlalchemy.pocoo.org/contexts/.
In conclusion, my scheduled jobs only work as long as they do not connect to the database. How can this be solved?
Thank you!