This one-page Flask program simply gets a simple Python Flask webpage up and running. Additionally it uses several other technologies useful in new projects.
Download the One Page Flask zipfile from Github. You will receive one_page_flask-master.zip. Unzip the file, and a new directory will be created. Rename it if you like.
From the command line, create a virtual environment and install flask. A python virtual environment is always recommended. Refer to Virtual Environment snippet.
1 2 3 4
cd one_page_flask-master mkvirtualenv one_page_flask-master pip install flask python app.py
Point browser to http://127.0.0.1:5000 and see the page:
This is a complete application in one python file. It has a basic HTML layout with just menu, hero, and body. The HTML is in a string at the bottom of app.py. There is actually a second version included in the project with a more interesting Bulma layout. This one is in a separate file, maxi.html. To view this, open app.py and modify the MINI parameter from True to False.