You are on page 1of 2

Role: Backend Developer / python Developer

version: 1.2

Python/Django Assignment
You are required to write a Django application to create RESTful services and performs the
following tasks:

1. Define a model for an employee that contains the following fields: id, name, age, gender,
department, salary.
2. Create an API endpoint that allows users to create new employees.
3. Create an API endpoint that returns a list of all employees with a pagination option.
4. Create an API endpoint that returns a single employee by ID.
5. Create an API endpoint that allows users to update an existing employee.
6. Create an API endpoint that allows users to delete an employee.
7. Implement validation for the input data received by the API endpoints.
a. Employee age cannot be more than 60.
b. Gender should M,F or T
8. Write unit tests for the API endpoints using Django's built-in testing framework.
9. Use Postman to test the API endpoints and verify that they return the expected data.

Requirements
1. The web application should be written in Django 4.x.
2. Use the Django REST framework to create the API endpoints.
3. The program should be well-documented and easy to understand.
4. The code should follow the PEP8 style guide.
5. Use exception handling to handle any errors that may occur.
6. Use object-oriented programming principles where appropriate.
7. Implement input validation for the API endpoints.
8. Write unit tests for the API endpoints using Django's built-in testing framework.
9. Use Postman to test the API endpoints and verify that they return the expected data.

Submission
1. Add the postman collection under the tests folder.
2. Submit a collection of Postman requests that test the API endpoints.
3. Create a github repo and push the code.
4. Share the github URL.

Bonus
The following are optional bonus tasks that you can complete to demonstrate your proficiency in
Python and Django:
1. Use Django's built-in authentication framework to create API endpoints that require
authentication.
2. Use Django's built-in authorization framework to restrict access to certain API endpoints
based on the user’s role.
3. Use Virtualenv to setup the python and other dependencies.
4. Create API documents using swagger.
5. Add unit tests.
6. Add a postman script to test the APIs.
7. Create Dockerfile to run the application inside a docker container.
8. Create a GitHub webhook to build the docker container and upload into the Jfrog registry
or docker hub.

You might also like