How to detect changes in extra files, and reload app, when deploying a Flask app?
<p>I built a little web app in Flask and am trying to deploy it on Pythonanywhere.</p>

<p>During development, I used a local server and launch my app as such:</p>

<pre><code>if __name__ == '__main__':
    app.run(debug=True,extra_files=['./static/results.csv',])
</code></pre>

<p>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:</p>

<pre><code>Detected change in '/Users/rodolphegonzales/sync/Survey/app/static/results.csv', reloading
</code></pre>

<p>Once I deploy on Pythonanywhere, this doesn't work anymore. when I run:</p>

<pre><code>if __name__ == '__main__':
    app.run(debug=False,extra_files=['./static/results.csv',])
</code></pre>

<p>I get:</p>

<pre><code>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.
</code></pre>

<p>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.</p>

<p>How to properly detect changes in extra files when deploying a Flask app?</p>

<p>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.</p>