The project uses a virtual environment to isolate package dependencies. To create the virtual environment and install required packages, run the following from a bash shell terminal:
$ source setup.sh$ .\setup.ps1$ source setup.sh --windowsOnce the setup script has completed and all packages have been installed, start the Flask app by running:
$ flask runYou should see output similar to the following:
* Serving Flask app "app" (lazy loading)
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with fsevents reloader
* Debugger is active!
* Debugger PIN: 226-556-590Now visit http://localhost:5000/ in your web browser to view the app.
The .env file is used by flask to set environment variables when running flask run. This enables things like developement mode (which also enables features like hot reloading when you make a file change).
- There's also a SECRET_KEY variable which is used to encrypt the flask session cookie.
When running setup.sh, the .env.template file will be copied to .env if the latter does not exist.