This project template uses Flask and Flask-Bootstrap and comes with the following folder structure:
- templates/
- index.html
- base.html
- another_page.html
- static/
- css/
- style.css
- js/
- script.js
- requirements.txt
- app.py
- Procfile
- README.md
HTML template files include:
base.html
which extends fromBootstrap/base.html
index.html
which extends frombase.html
and is served on the('/')
routeanother_page.html
which also extends frombase.html
and is served on the('/anotherpage')
route
- Download the repo zip file locally (or use
git clone
with the HTTPS URL), extract it, and name the root folder your project name - Open the project folder with your code editor
- Initialize Git with
git init
- Setup your Python virtual environment with:
python -m venv venv
- Activate your virtual environment with:
venv/Scripts/activate
in Powershellsource venv/bin/activate
in Terminal
- Install the project template's Python dependencies with:
pip install -r requirements.txt
Run the app with python app.py
. By default, the Flask server runs on 127.0.0.1:5000/
A Procfile
is also provided if you would like to deploy your app to a production grade server using Heroku. See https://devcenter.heroku.com/articles/getting-started-with-python#set-up