This is a Vendor Management System developed using Django and Django REST Framework. The system handles vendor profiles, tracks purchase orders, and calculates vendor performance metrics.
- Python 3.8+
- Django 3.2+
- Django REST Framework
- PostgreSQL (or any preferred database)
-
Clone the repository:
git clone https://github.com/your-repo/vendor-management.git cd vendor-management
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py makemigrations python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Access the admin site at
http://localhost:8000/admin/
and login with your superuser credentials.
-
Create a new vendor
POST /api/vendors/
-
List all vendors
GET /api/vendors/
-
Retrieve a specific vendor's details
GET /api/vendors/{vendor_id}/
-
Update a vendor's details
PUT /api/vendors/{vendor_id}/
-
Delete a vendor
DELETE /api/vendors/{vendor_id}/
-
Retrieve a vendor's performance metrics
GET /api/vendors/{vendor_id}/performance/
-
Create a purchase order
POST /api/purchase_orders/
-
List all purchase orders
GET /api/purchase_orders/
-
Retrieve details of a specific purchase order
GET /api/purchase_orders/{po_id}/
-
Update a purchase order
PUT /api/purchase_orders/{po_id}/
-
Delete a purchase order
DELETE /api/purchase_orders/{po_id}/
To access the API, you need to authenticate using JWT tokens.
-
Obtain a token
POST /api/token/
-
Refresh a token
POST /api/token/refresh/
Interactive API documentation is available at:
- Swagger UI:
http://localhost:8000/swagger/
- ReDoc:
http://localhost:8000/redoc/
Run the test suite to verify the functionality and reliability of the endpoints:
python manage.py test