This is a RESTful API in Django Rest Framework for a vendor management system. This system will handle vendor profiles, track purchase orders, and calculate vendor performance metrics.
- Create, read, update, and delete vendor profiles.
- Create, read, update, and delete purchase orders.
- Retrieve vendor performance metrics.
-
Clone the repository:
git clone https://github.com/your-username/vendor-management-system.git
-
Install dependencies:
cd vendor-management-system pip install -r requirements.txt
-
Run migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Access the API:
Open your browser and go to
http://localhost:8000/api/
to view the browsable API.
-
POST /api/vendors/
Create a new vendor.
-
GET /api/vendors/
List all vendors.
-
GET /api/vendors/{vendor_id}/
Retrieve details of a specific vendor.
-
PUT /api/vendors/{vendor_id}/
Update a vendor's details.
-
DELETE /api/vendors/{vendor_id}/
Delete a vendor.
-
POST /api/purchase_orders/
Create a new purchase order.
-
GET /api/purchase_orders/
List all purchase orders. You can filter by vendor using query parameters.
-
GET /api/purchase_orders/{po_id}/
Retrieve details of a specific purchase order.
-
PUT /api/purchase_orders/{po_id}/
Update a purchase order.
-
DELETE /api/purchase_orders/{po_id}/
Delete a purchase order.
-
POST /api/purchase_orders/{po_id}/acknowledge
Acknowledge a purchase order.
-
GET /api/vendors/{vendor_id}/performance/
Retrieve calculated performance metrics for a specific vendor.
To use the API endpoints, you can use tools like Postman or send HTTP requests using any programming language.
Here's an example using Postman:
To run tests, use the following command:
python manage.py test