I built a little web app in Flask and am trying to deploy it on Pythonanywhere.
During development, I used a local server and launch my app as such:
if __name__ == '__main__':
app.run(debug=True,extra_files=['./static/results.csv',])
results.csv serves as a tiny database (I don't need more) and everytime a line is added to the file, from a Flask form submition, the app is releaded. I then get:
Detected change in '/Users/rodolphegonzales/sync/Survey/app/static/results.csv', reloading
Once I deploy on Pythonanywhere, this doesn't work anymore. when I run:
if __name__ == '__main__':
app.run(debug=False,extra_files=['./static/results.csv',])
I get:
Internal Server Error. The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Looking at the log, this is due to the fact that the changes in results.csv weren't detected, and that the app wasn't reloaded.
How to properly detect changes in extra files when deploying a Flask app?
EDIT: file change detection and reload is apparently impossible to do outside of the debug mode. A touch to the WSGI should automatically reload, I'll try it out.