This repository contains code and examples for integrating Python applications with PostgreSQL databases.
This personal project demonstrates how to create a RESTful API backend using Python, Flask, and PostgreSQL. It includes Data Access Objects (DAOs), routes, and authentication using JWT.
- Python 3.6+
- PostgreSQL 10+
- psycopg2 (PostgreSQL adapter for Python)
# Clone the repository
git clone https://github.com/yourusername/python_postgres.git
# Navigate to the project directory
cd python_postgres
# Install dependencies
uv sync
Create a .env
file in the root directory with your database credentials:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=your_database
DB_USER=your_username
DB_PASSWORD=your_password
- CategoriesDAO
- ProductsDAO
- CustomersDAO
- OrdersDAO
- PartsDAO
- SuppliersDAO
- SuppliesDAO
- StudentsDAO
- Implement additional DAOs for other entities.
- Add unit tests for existing DAOs.
- Improve error handling and logging.