Does a Flask Request Run to Completion before another Request Starts?
I'm fairly certain that there is no guarantee of that. However, it depends on how you're running the application. If you're using Heroku+gunicorn for example, all files on Heroku that are changed during a request are not kept, i.e., the files are ephemeral. So if you were to change the text file, the changes would not persist through to the next request. Another provider, PythonAnywhere, is not so strict about their filesystem, but again, the requests would have no guarantee of one finishing before the next could start. Moreover, for a modern web server, that would be a useless application (or more accurately server).
Also if you want a small database, just use sqlite. As long as it is installed on the system, python comes with a library for interacting with it (if I remember correctly).
I ask because I'm wondering if I can get away with using a text file as a data store for a simple app. If each handler runs to completion, then it seems like I should be able to modify the text file during that request without worrying about conflicts, assuming I close the file at the end of each request.
Is this feasible? Is there anything special I need to do in order to use a text file as a data store in a Flask app?