An API for managing a training center using Django Rest Framework (DRF). It allows managing courses, students, and scores, as well as establishing relationships between them. The API provides CRUD (Create, Read, Update, Delete) functionality for each entity, along with search and filtering capabilities.
- Python 3.7 or higher
- Django 3.2 or higher
- Django Rest Framework 3.12 or higher
-
Clone the project repository:
git clone https://github.com/qwerty2053/training_center.git
-
Navigate to the project directory:
cd training_center
-
Install dependencies:
pip install -r requirements.txt
-
Create the database:
python manage.py migrate
-
Start the development server:
python manage.py runserver
GET /api/courses/
- Retrieve a list of coursesPOST /api/courses/
- Create a new courseGET /api/courses/{id}/
- Retrieve details of a course by IDPUT /api/courses/{id}/
- Update a course by IDDELETE /api/courses/{id}/
- Delete a course by ID
GET /api/students/
- Retrieve a list of studentsPOST /api/students/
- Create a new studentGET /api/students/{id}/
- Retrieve details of a student by IDPUT /api/students/{id}/
- Update a student by IDDELETE /api/students/{id}/
- Delete a student by ID
GET /api/scores/
- Retrieve a list of scoresPOST /api/scores/
- Create a new scoreGET /api/scores/{id}/
- Retrieve details of a score by IDPUT /api/scores/{id}/
- Update a score by IDDELETE /api/scores/{id}/
- Delete a score by ID
POST /api/courses/{course_id}/enroll/{student_id}/
- Enroll a student in a course
GET /api/courses/?search=<query>
- Search for courses by nameGET /api/students/?search=<query>
- Search for students by first and last name
id
(integer): Course IDname
(string): Course namedescription
(string): Course descriptionduration
(duration): Course duration
id
(integer): Student IDfirst_name
(string): Student's first namelast_name
(string): Student's last nameemail
(string): Student's emailcourses
(many-to-many): Courses associated with the student
id
(integer): Score IDvalue
(integer): Score value (from 1 to 10)date
(date): Date of the scorecourse
(integer): Course ID associated with the scorestudent
(integer): Student ID associated with the score