This folder contains a minimal Flask example app that supports the explanation of the MVC pattern in Model-View-Controller (MVC) Explained – With Lego.
To run the app, you'll need to first install Flask, preferably into a virtual environment:
(venv) $ python -m pip install Flask
Then, you can start the Flask app by executing app.py
:
(venv) $ python app.py
When you make a request in your browser by typing the URL of your localhost and port 8000, you'll see how Flask renders the single view that this web app defines.
Note: The SQLite database file was created by running create_db.py
. You can modify this file to change the content in the database. Then run the script to update the database:
(venv) $ python create_db.py