Skip to content

This is Task to develop a Vendor Management System using Django and Django REST Framework. This system will handle vendor profiles, track purchase orders, and calculate vendor performance metrics.

navansh03/Vendor-Management-System

Repository files navigation

Vendor-Management-System

This is a Vendor Management System developed using Django and Django REST Framework. This system handles vendor profiles, tracks purchase orders, and calculates vendor performance metrics.

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/navansh03/Vendor-Management-System.git

    Locating to the Project Directory:

    cd Vendor-Management-System
  2. Create a virtual environment:

    python -m venv env
  3. Activate the virtual environment:

    • On Windows, run:
      .\env\Scripts\activate
    • On Unix or MacOS, run:
      source env/bin/activate
  4. Install the required packages:

    pip install -r requirements.txt
  5. Build the Docker image:

    docker build -t vendor-management-system-django-1 .
  6. Run the Docker container:

    docker run -p 8000:8000 vendor-management-system-django-1:latest

The application should now be running at http://localhost:8000.

Creating a User

To create a user, you can use the Django admin interface. First, run the following command to create a superuser:

cd ManagementSystem
python manage.py createsuperuser

API Documentation

Token Generation

To generate a token, send a POST request to http://localhost:8000/api/token/ with your username and password in the body. Here's an example using curl:

curl -X POST -H "Content-Type: application/json" -d '{"username":"yourusername","password":"yourpassword"}' http://localhost:8000/api/token/
Please replace yourusername and yourpassword with your actual username and password which you have created.

You can then use this token in your API requests by including it in the Authorization header, prefixed with Token :

curl -X GET -H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" http://localhost:8000/api/vendors/

Postman Collection

A Postman collection is included in the project directory to help you interact with the API. This collection contains pre-configured requests for all the API endpoints.

To use the Postman collection:

  1. Open Postman.
  2. Click on "File" -> "Import...".
  3. Choose the Vendor Management System.postman_collection.json file from the project directory.
  4. After importing, you'll see the collection in the "Collections" tab. You can now use these requests to interact with the API.

API Endpoints

All API endpoints are documented in Swagger. After running the application, you can access the Swagger UI at http://localhost:8000/swagger.

The Swagger UI provides a comprehensive list of all API endpoints, along with descriptions and examples for each one. You can also try out the API directly from the Swagger UI.

Running Tests

Then, to run the test suite, execute the following command:

python manage.py test

This will run all the tests in your Django project and display the results in the terminal

Contact

If you have any questions or issues, feel free to contact the developer. You can reach me at:

About

This is Task to develop a Vendor Management System using Django and Django REST Framework. This system will handle vendor profiles, track purchase orders, and calculate vendor performance metrics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published