Backend Development with Python, Django, Django REST Framework and Pydantic

Why Smarter. Smarter is a large Django project that follows the community’s conventions closely, and its Django apps follow a deliberately rigid structure, so that once students understand one app they can read them all. It shows patterns that small tutorial projects never reach: custom management commands, Celery background tasks, caching, Pydantic models for every API contract, and a broker layer that turns YAML manifests into database rows.

Look at. smarter/smarter/apps/ (start with guardrail and secret, the newest and cleanest), smarter/smarter/lib/, and the Architecture Decision Records, especially those on Django, the broker model, caching, task queues and Pydantic.

Read. Smarter Broker Model, Smarter API, Pydantic, Getting Started (a reading list for these technologies).

Exercises.

  • Trace one smarter apply request from the URL route, through the DRF view and the broker, to the Django model, and draw a sequence diagram.

  • Add a field to an existing resource’s manifest: the Pydantic model, the Django model and its migration, the broker, and the tests.

  • Write a manage.py command, following smarter/smarter/apps/account/management/commands/.

  • As a capstone, add a new resource kind end to end, following New Feature Checklist.

Course plans. Three complete, ready-to-teach plans, each with a schedule, graded assignments and rubrics, two capstone projects, recommended texts, further study and technical prerequisites. See Course Formats and Grading for what the formats have in common.

See the Smarter Instructor Guide to install Smarter and set up a class.