Flask is distributed as a Python package. With the virtual environment active, install it with
Next, we are going to add some more structure to the folder hierarchy. Use the command below to create the app directory which will contain all of the code that is specific to our application.
To identify this directory as a local Python package, it must contain an initialisation file. The command below creates an empty file with the right name.
To create a minimal Flask application, place the code below into the file
1 2 3 4 5 6 7 8 9 10
At this point, you should be able to start the Flask development server process to see that the app is running correctly, but only if you have access to port 5000. This port may not be available on servers whose firewall is centrally controlled such as those provided by a University's Information Services department. To see the Flask application running in that situation, you also need to configure WSGI.