The Invoices project is a Django application built using Django Rest Framework (DRF) to manage invoices and invoice details. It provides APIs for CRUD operations on invoices and invoice details.
-
Clone the repository:
git clone https://github.com/Shankjbs571/thisCreate.git
-
Navigate to the project directory:
cd thisCreate
-
Create a virtual environment and activate it (optional but recommended):
python -m venv env source env/bin/activate # for Linux/macOS .\env\Scripts\activate # for Windows
-
Install the dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Access the API endpoints at:
GET /api/invoices/
: List all invoices.POST /api/invoices/
: Create a new invoice.GET /api/invoices/<pk>/
: Retrieve a specific invoice.PUT /api/invoices/<pk>/
: Update a specific invoice.DELETE /api/invoices/<pk>/
: Delete a specific invoice.GET /api/invoice-details/
: List all invoice details.POST /api/invoice-details/
: Create a new invoice detail.GET /api/invoice-details/<pk>/
: Retrieve a specific invoice detail.PUT /api/invoice-details/<pk>/
: Update a specific invoice detail.DELETE /api/invoice-details/<pk>/
: Delete a specific invoice detail.
-
Create a new invoice:
curl -X POST http://localhost:8000/api/invoices/ -d "date=2022-03-01&customer_name=John Doe"
-
Update an invoice:
curl -X PUT http://localhost:8000/api/invoices/1/ -d "date=2022-03-02"
-
Delete an invoice:
curl -X DELETE http://localhost:8000/api/invoices/1/
- Python 3.x
- Django
- Django Rest Framework