https://github.com/themusharraf/mvc
Python veb-ilovalarida Model-View-Controller (MVC): Lego bilan tushuntirilgan ✅
https://github.com/themusharraf/mvc
flask flask-api flask-application flask-sqlalchemy lego mvc mvc-architecture python3
Last synced: 2 months ago
JSON representation
Python veb-ilovalarida Model-View-Controller (MVC): Lego bilan tushuntirilgan ✅
- Host: GitHub
- URL: https://github.com/themusharraf/mvc
- Owner: themusharraf
- Created: 2024-03-23T10:34:45.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-27T06:53:25.000Z (over 2 years ago)
- Last Synced: 2025-02-09T09:29:10.553Z (over 1 year ago)
- Topics: flask, flask-api, flask-application, flask-sqlalchemy, lego, mvc, mvc-architecture, python3
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Model-View-Controller (MVC) in Python Web Apps: Explained With Legos
This folder contains a minimal Flask example app that supports the explanation of the MVC pattern in [Model-View-Controller (MVC) Explained – With Lego](https://realpython.com/lego-model-view-controller-python/).
To run the app, you'll need to first install [Flask](https://flask.palletsprojects.com/), preferably into a [virtual environment](https://realpython.com/python-virtual-environments-a-primer/):
```sh
(venv) $ python -m pip install Flask
```
Then, you can start the Flask app by executing `app.py`:
```sh
(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:
```sh
(venv) $ python create_db.py
```