An entry for the TSA Webmaster HS 2021-2022 competition by students at Mountlake Terrace High School.
All instructions are for Windows
- Clone the repo
- Install Python
- Create a virtual environment in the project root directory (
cd ../..
if you're coming from the last step) with the commandpython -m venv .venv
- Activate with the command
.venv\Scripts\activate
. Terminal should now show (.venv) on the left - you deactivate with the commanddeactivate
- Install requirements with command
pip install -r requirements.txt
- Any new packages installed with pip can be saved to the requirements with the command
pip freeze > requirements.txt
- [Optional] Configure python interpreter in your text editor selecting using the virtual environment
- Set proper environment variables
- From the project root, run the website with command
python run.py
- You can see the website on http://localhost:5000/
This website uses flask for the backend with a basic package file structure. The __init__.py file creates the flask app object, views.py is where all the routes (code to render pages) goes, html files go in templates folder, everything else (css, js, and images) go in the static folder. Remember to use url_for which is imported from flask to reference all files or pages in the project.