Folder layout
api/
├── manage.py # the Django command: runserver, migrate…
├── trinity_api/ # the Django project
│ ├── settings.py # settings, read from the environment
│ ├── urls.py # addresses: /admin/, /health, /api/
│ └── wsgi.py # Gunicorn entry point
├── products/ # the "products" application
│ ├── models.py # the Product table
│ ├── serializers.py # Product ↔ JSON
│ ├── views.py # ProductViewSet
│ ├── admin.py # Product in the Django admin
│ ├── tests.py # the 7 tests
│ └── migrations/ # the table's history
├── requirements.txt # Python libraries
├── pytest.ini # pytest settings
├── entrypoint.sh # prod image startup: migrate + collectstatic
├── Dockerfile.dev # development image
├── Dockerfile.prod # production image
├── .gitlab-ci.yml # api:lint, api:test, api:build jobs
└── .env.example # expected variables, with example valuesThe layout rule
| File | Contains | Does not contain |
|---|---|---|
models.py | the table's fields and constraints | HTTP logic |
serializers.py | which fields to expose, which are read-only | direct access to the request |
views.py | which operations are possible | JSON format |
urls.py | addresses | business logic |