This project demonstrates Python REST API capabilities.
- Install uv
- From the project root, create the .venv folder and install the locked dependencies (Python 3.14 is downloaded automatically if missing)
uv sync - Add or remove libraries with
uv add <package>/uv remove <package>, then regeneraterequirements.txtuv export --format requirements-txt --no-hashes -o requirements.txt
- Create and activate a virtual environment with Python 3.14
python3.14 -m venv .venv source .venv/bin/activate - Install the pinned dependencies
pip install -r requirements.txt - Run the project with
python -m com.demo.web.CustomersControllerinstead ofuv run ...
- Configure DB credentials here
- And create database employees and table customers with the following commands
create database if not exists employees;
create table if not exists employees.customers
(
name varchar(40) null,
address varchar(200) null
);
- Run com/demo/web/CustomersController.py from the project root
uv run python -m com.demo.web.CustomersController - Go to http://127.0.0.1:5000 to see list of customers
- Create new customer using the URL http://127.0.0.1:5000/create