Note: We will be continuing with the project we started in the previous week. If you haven’t completed the tasks from the previous week, please complete them first.
You have to install Django REST Framework in your project. You can refer to the official documentation for more details.
settings.py
file to add Django REST Framework to the installed apps.Now we will be transforming our existing Django project into a REST API. You can refer to the official documentation for more details.
views.py
to add the necessary logic for the APIs. You are only allowed to use function based views for this task.Note: You can create new models and/or modify the existing models if you want to.
You have to add authentication to your project. You can refer to the official documentation for more details.
settings.py
, urls.py
and other neccessary files to add Simple JWT to the project.Add Product
and Purchase Product
APIs created in the previous task accessible only to authenticated users and Delete Product
API accessible only to the user who created the product. Put necessary restrictions on Purchase Product
API so that a user can only purchase a product once, a user cannot purchase a product created by them, etc. (DO NOT delete the product after it has been purchased.)Now we will be finally documenting our APIs in Postman. You can refer to the official documentation for more details.
backend
directory.