- You need to create a single url
/invoices/
for this
/invoices/
/invoices/<int:pk>/
- Create two Django models viz. Invoice and Invoice Detail.
- Invoice model fields -> Date, Invoice CustomerName.
- InvoiceDetail model fields -> invoice (ForeignKey), description, quantity, unit_price, price.
- Create APIs using Django Rest Framework for all the HTTP methods for the invoice models.
- The API should also accept invoice_details in the payload and create/update the associated invoice details too
- Create test cases to test all the API endpoints.
Follow these steps to set up and run the GreatKart E-commerce Website on your local machine:
-
Clone the GitHub Repository:
git clone https://github.com/sree-hari-s/Task-Invoice.git
-
Install and create a virtual environment:
virtualenv env
-
Activate the virtual environment:
-
On Windows:
env\Scripts\activate
-
-
Install the project requirements:
pip install -r requirements.txt
-
Create a
.env
File and Fill in Required Environment Variables In your project directory, create a.env
file and fill in the required environment variables as follows:SECRET_KEY=django_secret_key DEBUG=True/False
-
Migrate the project to the database:
python manage.py makemigrations python manage.py migrate
-
Run the project:
python manage.py runserver