This project demonstrates a REST API for managing "teams" and "people in those teams" using Django Rest Framework. The API allows performing CRUD (Create, Read, Update, Delete) operations for "team" and "person" objects.
-
Clone the repository:
git clone https://github.com/YuliaHladyshkevych/TeamManager.git cd TeamManager
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # for Windows: venv\Scripts\activate
-
Install required packages:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Populate the database with initial data (optional):
python manage.py populate_data
-
Run the development server:
python manage.py runserver
-
Get a list of teams:
GET /teams/
-
Create a new team:
POST /teams/
Request body:
{ "name": "Team Name", "description": "Team Description" }
-
Get a team by ID:
GET /teams/{id}/
-
Update a team by ID:
PUT /teams/{id}/
Request body:
{ "name": "Updated Team Name", "description": "Updated Team Description" }
-
Delete a team by ID:
DELETE /teams/{id}/
-
Get members of a team:
GET /teams/{id}/members/
-
Add a member to a team:
POST /teams/{id}/add_member/
Request body:
{ "person_id": 1 }
-
Filter members by first_name or/and last_name:
GET /teams/{id}/filter_members/?first_name={first_name}&last_name={last_name}
-
Get a list of people:
GET /people/
-
Create a new person:
POST /people/
Request body:
{ "first_name": "First Name", "last_name": "Last Name", "email": "[email protected]", "team": 1 }
-
Get a person by ID:
GET /people/{id}/
-
Update a person by ID:
PUT /people/{id}/
Request body:
{ "first_name": "Updated First Name", "last_name": "Updated Last Name", "email": "[email protected]", "team": 2 }
-
Delete a person by ID:
DELETE /people/{id}/
-
Filter persons by first_name or/and last_name:
GET /people/filter_persons/?first_name={first_name}&last_name={last_name}