Project 10 OpenClassrooms Path - SoftDesk -- create a secure RESTful API using Django REST
For the SoftDesk project we created an RESTful API from scratch. The User model got additional attributes, for GDPR regulations. The user should have the possibility to view, edit and delete the information.
A user can create different types of projects, add other users as contributor(s) and add issues to these projects. The issue has different tags, states and priorities. An issue can be assigned to a contributor or to the author itself. Out of the issue a user/contributor can create comments.
To guarantee just the author (creating user, no contributor) of a project is able to edit or delete a project, issue and comment, we implemented permissions. For the “Green Code” implementation, I have created several serializers for different purposes, added pagination and reduced database queries with the creation of view properties.
open terminal:
git clone https://github.com/DoriDoro/SoftDesk_api.git
cd SoftDesk_api
pipenv install
this command installs all necessary requirements and installs the virtual environmentpipenv shell
activates the virtual environmentpython manage.py runserver
this command starts the server
- use: http://127.0.0.1:8000/api/ in browser to check the API
- BETTER OPTION: go to Postman and make some tests
http://127.0.0.1:8000/api/login/
username: ThePing
password: HelloThere55
http://127.0.0.1:8000/api/projects/
http://127.0.0.1:8000/api/projects/1/contributors/
http://127.0.0.1:8000/api/projects/1/issues/
http://127.0.0.1:8000/api/projects/1/issues/1/comments/
http://127.0.0.1:8000/api/users/
- Securing an API to comply with OWASP and RGPD standards
- Creating a RESTful API with Django REST
all images are Postman visualisations.
1. GET all projects of the logged-in user:
2. GET detailed version of one project of logged-in user:
3. GET all issues of the logged-in user:
4. GET detailed issue of one issue:
5. GET all comments of logged-in user: