A simple RESTful API for managing Entity records, built with Django and Django Ninja.
- Full CRUD operations for entities
- Interactive OpenAPI/Swagger documentation at
/api/docs - Tests with pytest + coverage reporting
- Production-ready structure (PostgreSQL + Docker friendly)
| Field | Type | Required | Notes |
|---|---|---|---|
id |
int | auto | Primary key |
type |
string(100) | yes | Entity type |
name |
string(255) | no | Descriptive name |
description |
text | no | Detailed description |
created_at |
datetime | auto | Creation timestamp |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/entities |
List all entities |
| GET | /api/entities/{id} |
Retrieve single entity |
| POST | /api/entities |
Create a new entity |
| PUT | /api/entities/{id} |
Update an existing entity |
| DELETE | /api/entities/{id} |
Delete an entity |
- Python 3.11+
- Virtual environment recommended (
venv)
# Linux/macOS:
python -m venv .venv
source .venv/bin/activate
# or on Windows (PowerShell):
.\.venv\Scripts\Activate.ps1pip install -r requirements.txtpython manage.py migratepython manage.py runserverInteractive API documentation will be available at:
http://localhost:8000/api/docs
pytest --cov=entities --cov-report=html:coverage_htmlpython -m http.server --directory coverage_html 8000→ open http://localhost:8000
