Original course code | Code updated to Flask 2.0
This is a simple web-based blog that doesn't do much but introduces Flask, HTML, CSS, Bootstrap, Jinja2, and other concepts such as endpoints and APIs.
The blog requires MongoDB to be running without authentication enabled.
Once this is running, execute the app with flask run and navigate to the endpoint (default: http://127.0.0.1:5000/).
The available endpoints are:
//login/register/blogs/blogs/new/posts/<string:blog_id>/posts/new/<string:blog_id>
- Create a new virtual environment:
python -m venv .venv - Activate the virtual environment:
In powershell:
.\.venv\Scripts\activateIn bash
source .venv/Scripts/activateIn CMD
.venv\Scripts\activateIn Mac OS / Linux:
source .venv/bin/activate-
Verify that the file
.flaskenvis in the top directory and that it contains the environment variableFLASK_APP=src.app. -
Run the app
flask run