This is an example application featured in my Flask Mega-Tutorial. See the tutorial for instructions on how to work with it.
Before I end this chapter, I will do one more thing. Since environment variables aren't remembered across terminal sessions, you may find tedious to always have to set the FLASK_APP environment variable when you open a new terminal window. Starting with version 1.0, Flask allows you to register environment variables that you want to be automatically imported when you run the flask command. To use this option you have to install the python-dotenv package:
Then you can just write the environment variable name and value in a file named .flaskenv located in the top-level directory of the project: