sree-hari-s / Task-Invoice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django - Task

Create a Django application (Django Rest Framework) using the given information:

  • 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.

Installation

Follow these steps to set up and run the GreatKart E-commerce Website on your local machine:

  1. Clone the GitHub Repository:

    git clone https://github.com/sree-hari-s/Task-Invoice.git
  2. Install and create a virtual environment:

    virtualenv env
  3. Activate the virtual environment:

    • On Windows:

      env\Scripts\activate
  4. Install the project requirements:

    pip install -r requirements.txt
  5. 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
  6. Migrate the project to the database:

    python manage.py makemigrations
    python manage.py migrate
  7. Run the project:

    python manage.py runserver

About


Languages

Language:Python 100.0%