A REST API for managing student records built with Django REST Framework.
- CRUD operations for students (Create, Read, Update, Delete)
- PostgreSQL database
- Health check endpoint
-
Create environment file
cp .env.example .env.local
Update
SECRET_KEYandDEBUGin.env.local. TheDATABASE_URLis configured by Docker Compose. -
Build and start containers
make docker-build
-
Run migrations
make docker-migrate
-
View logs
make docker-logs
-
Stop containers
make docker-down
-
Create environment file
cp .env.example .env.local
Update
SECRET_KEY,DEBUG, andDATABASE_URLin.env.local. -
Install dependencies
make install
-
Run migrations
make migrate
-
Run server
make run
The API will be available at http://localhost:8000
| Method | Endpoint | Description |
|---|---|---|
| GET | /healthcheck/ |
Health check |
| GET | /api/students/ |
List all students |
| POST | /api/students/ |
Create a student |
| GET | /api/students/<id>/ |
Get a student |
| PUT | /api/students/<id>/ |
Update a student |
| DELETE | /api/students/<id>/ |
Delete a student |
| Field | Type | Description |
|---|---|---|
| id | integer | Auto-generated ID |
| first_name | string | First name (max 100 chars) |
| last_name | string | Last name (max 100 chars) |
| string | Email address (unique) | |
| date_of_birth | date | Date of birth (YYYY-MM-DD) |
| created_at | datetime | Record creation timestamp |
| updated_at | datetime | Last update timestamp |
make docker-build- Build and start containersmake docker-migrate- Run database migrationsmake docker-logs- View container logsmake docker-down- Stop containers
make install- Install dependenciesmake migrate- Run database migrationsmake run- Start the development servermake test- Run testsmake lint- Check for syntax errors