Giter Site home page Giter Site logo

products-django-api's Introduction

Django API CRUD

This project is a Django API that implements CRUD (Create, Read, Update, Delete) functionality for managing products.

Table of Contents

Introduction

This Django API provides endpoints to perform CRUD operations on products. It is designed to be easily integrated into Django projects requiring a RESTful API backend.

Features

  • Create, Read, Update, and Delete operations for managing products.
  • RESTful API design for easy integration with frontend applications.
  • Django ORM for database operations.

Getting Started

Follow these instructions to set up the project locally.

Prerequisites

  • Python (>=3.6)
  • Django

Installation

  1. Clone the repository:

    git clone https://github.com/Ngaremaina/Products-Django-API
    
  2. Navigate to the project directory:

    cd Products-Django-API
    
  3. Install and activate a virtual environment:

    python -m virtualenv env
    source env/bin/activate
    
  4. Install dependencies:

    pip install -r requirements.txt
    
  5. Apply database migrations:

    python manage.py migrate
    
  6. Run the development server:

    python manage.py runserver
    

Usage

To use the API, you can make requests to the defined endpoints using tools like curl, Postman, or integrate it into your frontend application.

API Endpoints

Products

  • GET http://127.0.0.1:8000/products/: Retrieve all products.
  • GET http://127.0.0.1:8000/products/<id>/: Retrieve a specific product.
  • POST http://127.0.0.1:8000/products/: Create a new product and its variants.
  • PUT http://127.0.0.1:8000/products/<id>/: Update a specific product.
  • DELETE http://127.0.0.1:8000/products/<id>/: Delete a specific product.

Variants

  • GET http://127.0.0.1:8000/variants/: Retrieve all variants.
  • GET http://127.0.0.1:8000/variants/<id>/: Retrieve a specific variant.
  • POST http://127.0.0.1:8000/variants/: Create a new variant for a specific product.
  • PUT http://127.0.0.1:8000/variants/<id>/: Update a specific variant for a specific product.
  • DELETE http://127.0.0.1:8000/variants/<id>/: Delete a specific variant.

License

This project is licensed under the Apache License.

products-django-api's People

Contributors

ngaremaina avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.