This project is a Django application which stores information about different types of Pizza. I created an API interface that lists the information about the different stored pizzas and can also edit & delete the pizzas information.
If the request given is:
GET /api/pizza_api
Then the response is:
[
{
"pizzaType": "Regular",
"pizzaSize": "Large",
"toppings": "Onions"
},
{
"pizzaType": "Square",
"pizzaSize": "Large",
"toppings": "corn"
},
{
"pizzaType": "Regular",
"pizzaSize": "small",
"toppings": "corn"
},
{
"pizzaType": "Square",
"pizzaSize": "small",
"toppings": "cheese"
}
]
If the request given is:
POST /api/pizza_api
{
"pizzaType": "Regular",
"pizzaSize": "Medium",
"toppings": "Tomato"
}
Then the response is:
{
"id":8,
"pizzaType":"Regular",
"pizzaSize":"Medium",
"toppings":"Tomato"
}
If the request given is:
PUT /api/pizza_api/:id
Example:
{
"pizzaType": "Regular",
"pizzaSize": "Large",
"toppings": "Capsicum"
}
Then the response is:
{
"id":8,
"pizzaType":"Regular",
"pizzaSize":"Large",
"toppings":"Capsicum"
}
If the request given is:
DELETE /api/pizza_api/:id
Example:
{
"pizzaType": "Regular",
"pizzaSize": "Large",
"toppings": "Capsicum"
}
Then the response is:
"Deleted Successfully"
If the request given is:
GET /api/pizza_api?type=Regular&size=Large
Then the response is:
[
{
"pizzaType": "Regular",
"pizzaSize": "Large",
"toppings": "Onions"
}
]
To run this project:
Run this command
git clone https://github.com/Thanujathanu20/pizza.git
pip install -r requirements.txt
python manage.py runserver