coderj001 / Djongo-PizzaApi

Django project created using mongodb database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pizza API

Django, MongoDB, Djongo, DRF

This is project is base curd app built with MongoDB database connection.

Online Deployed : link

Installation

  1. Create a python virtual environment and install requirements by using cmd pip install -r requirements.txt
  2. Add environment variable with config env file. And run python manage.py runserver.

Usage

  • For swagger ui use link
  • For redoc use link
  • Django has build-in admin panal link with username: admin and password: admin

API ENDPOINTS

Base url route: http://localhost:8000/api

  • /pizza-size : [GET, POST]
    • GET - show list of pizza size
    • POST - add new size { "name": "Medium" }
  • /pizza-topping : [GET, POST]
    • GET - show list of pizza topping
    • POST - add new topping { "name": "Onion" }
  • /pizza : [GET, POST]
    • GET - show list of pizza with all info with filter params ?type_pizza=regular&size_pizza=Small
      • type_pizza : regular or square
      • size_pizza : by name present on list /pizza-size
    • POST - add new pizza { "name": "Margherita", "type_pizza": "square", "size_pizza": "Small", "topping_pizza": "Cheese", "description": "Sticky" }
      • name : char
      • type_pizza : only two option square or regular
      • size_pizza : if it present on /pizza-size list then it only can be added
      • topping_pizza : if it present on /pizza-topping list then it only can be added
      • description : text
  • /pizza/:id : [GET, PUT, DELETE]
    • GET - show list of pizza with all info
    • PUT - add new pizza { "name": "Margherita", "type_pizza": "square", "size_pizza": "Small", "topping_pizza": "Cheese", "description": "Sticky" }
      • name : char
      • type_pizza : only two option square or regular
      • size_pizza : if it present on /pizza-size list then it only can be added
      • topping_pizza : if it present on /pizza-topping list then it only can be added
      • description : text
    • DELETE - delete the pizza with id

Postman

Use postman file , export 'PizzaAPI.postman_collection.json' on postman software.

About

Django project created using mongodb database


Languages

Language:Python 98.3%Language:HTML 1.4%Language:CSS 0.1%Language:JavaScript 0.1%