You have to create a Django application which should be able to store information about different types of Pizza, then create an API interface that lists the information about all the different stored pizzas, and also be able to interact with that information (such as edit or delete).
MongoDB should be configured with the project. Our database should be able to store information about Pizza, following are the details :
- A Pizza can be of multiple types : Regular or Square
- A Pizza can be of multiple sizes : Small, Medium, Large, etc. (These are just examples, the user should be allowed to add any other size at any point of time)
- A Pizza can consist of many toppings out of the following (Onion, Tomato, Corn, Capsicum, Cheese, Jalapeno etc.), the choice of toppings should not be limited to the ones mentioned above, the user should be allowed to add any type of topping at any point of time)
- Create an API endpoint to create regular pizza and a square pizza.
- Create an API endpoint which lists the information about all the stored pizza, the response of this should also contain the information about the toppings, size and type of Pizza.
- Allow filtering the list of pizza returned by the API based on Size & Type of Pizza.
- Create an API endpoint that allows the user to edit or delete any pizza from the database.
-
The API should return proper 40x codes when any kind of wrong input is sent to the API, the server should not return 500 errors
-
The user should not be able to create a pizza of any other type except Regular and Square.
-
The user should not be able to create pizza of size which isn't present in the database.
git clone https://github.com/rishank-shah/drf-pizza-api.git
cd drf-pizza-api
cp .env.example .env
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
source .env
python manage.py migrate
python manage.py runserver
http://localhost:8000 Check below for API Endpoints