This project is a backend system for an online learning platform developed using Django REST Framework (DRF) and PostgreSQL. The project has been dockerized for easy deployment.
-
GET /courses: Retrieves a list of available courses.
-
GET /courses/id: Retrieves a specific course by its ID.
-
POST /courses: Create a new course.
- POST /enrollments: Allows students to enroll in a course.
To set up and run the project locally, follow these steps:
- Clone the project.
git clone https://github.com/kaziiriad/django_ols.git
- Navigate to the project directory:
cd django_ols
-
Modify the
env.example
to.env
and add API credentials: -
Build and run the Docker containers:
docker-compose up --build
- Access the API endpoints through the appropriate URLs:
- Course API:
http://localhost:8000/api/courses
- Enrollment API:
http://localhost:8000/api/enrollments
- Django
- Django REST Framework
- PostgreSQL
- Docker
- Retrieve a list of courses: Send a GET request to
/courses
. - Retrieves a filtered list of available courses using properties like instructor, price or duration: GET
/courses/?{query_params}
- Retrieve a specific course by ID: Send a GET request to
/courses/id
, replacingid
with the ID of the course. - Create a new course: Send a POST request to
/courses
with the required course details in the request body. - Enroll in a course: Send a POST request to
/enrollments
with the necessary enrollment information in the request body.
Testing has been conducted to ensure the expected behavior of the backend system. You can run the tests using the following command:
- Start the database
docker compose -d up db
- Run the test
python manage.py test
This project is licensed under the MIT License.