A simple and clean CRUD (Create, Read, Update, Delete) application built using:
- Python
- Flask
- MySQL
- Tailwind CSS
- Jinja Templates
This project demonstrates how to connect Python to MySQL and handle CRUD operations through a web-based UI.
- Add new items
- Edit existing items
- Delete items
- Display items in a table
- Fully functional MySQL connectivity
- Modern UI with TailwindCSS
flask-mysql-crud/
│── app.py
│── db.py
│── config.py (ignored in Git)
│── config.example.py
│── requirements.txt
│── templates/
│ ├── base.html
│ ├── index.html
│ ├── add.html
│ └── edit.html
git clone https://github.com/your-username/flask-mysql-crud.git
cd flask-mysql-crudpip install -r requirements.txtLog in to MySQL and run:
CREATE DATABASE flask_crud;
USE flask_crud;
CREATE TABLE items (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255),
price DECIMAL(10,2)
);Rename:
config.example.py → config.py
Edit config.py:
HOST = "localhost"
USER = "root"
PASSWORD = ""
DATABASE = "flask_crud"python app.pyVisit:
http://127.0.0.1:5000/
| Operation | Description |
|---|---|
| CREATE | Add item via /add |
| READ | List all items on homepage |
| UPDATE | Edit item via /edit/<id> |
| DELETE | Remove item via /delete/<id> |
- Backend: Python, Flask
- Database: MySQL
- Frontend: HTML, TailwindCSS
- Template Engine: Jinja2
This project is open-source and free to use.
Pull requests are welcome. For major changes, please open an issue first to discuss.