A simple and clean Course Management API built with Django REST Framework using GenericAPIView + Mixins.
- Full CRUD for courses (List, Create, Retrieve, Update, Delete)
- Custom filtering using query parameters
- Serializer field validation
- Custom "Deactivate" endpoint for soft deletion
- Versioned routes (
/api/v1/courses/)
- Python 3.12
- Django 5
- Django REST Framework (DRF)
-
Clone the repository
git clone https://github.com/mopy7/course-management-api.git cd course-management-api -
Create and activate a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Run migrations
python manage.py makemigrations python manage.py migrate
-
Start the development server
python manage.py runserver
-
Open in browser or Postman
http://127.0.0.1:8000/api/v1/courses/
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/courses/ |
List all courses |
| POST | /api/v1/courses/ |
Create a new course |
| GET | /api/v1/courses/<id>/ |
Retrieve a course |
| PUT / PATCH | /api/v1/courses/<id>/ |
Update a course |
| DELETE | /api/v1/courses/<id>/ |
Delete a course |
| POST | /api/v1/courses/<id>/deactivate/ |
Deactivate (soft delete) a course |
Mopy
"Miles to go before I sleep..."