Rustango docs
← Rustango 0.45

Cookbook

Chapter 1 — Project shape & manage commands

What: Scaffolder that emits the canonical Django-shape project layout. When: Brand-new project, or adding a new sub-app to an existing one.

Chapter 2 — Models & schema

Models live in src/apps/blog/models.rs. Live tests against docker PG in tests/cookbook_chapter02_models.rs. Run with DATABASEURL=... cargo test --test…

Chapter 3 — ORM

13 live recipes against the Author / Post fixture from Chapter 2. Run with DATABASEURL=... cargo test --test cookbookchapter03orm -- --test-threads=1.

Chapter 4 — Migrations

5 live recipes against docker PG verifying the migration lifecycle. Run with DATABASEURL=... cargo test --test cookbookchapter04migrations --…

Chapter 5 — Multi-tenancy

One comprehensive live test that provisions two tenants in schema mode, then exercises every resolver against the seeded registry. Run with…

Chapter 6 — Auth + permissions

7 live tests on the password / API-key / JWT / permission primitives. No DB needed — pure crypto. Run with cargo test --test cookbookchapter06auth.

Chapter 7 — Forms + serializer

6 tests covering ModelFormFor<T> parse/fromjson/error aggregation/ bound-validation/null handling/insert-query emission. No DB needed. Run with cargo test…

Chapter 8 — Admin

Two parts: in-process router smoke + a real-browser playwright session.

Chapter 9b — Template views (Django-shape CBVs)

API: `template_views::ListView`, `template_views::DetailView`, `template_views::CreateView`, `template_views::UpdateView`, `template_views::DeleteView`.

Chapter 9 — ViewSets / DRF / OpenAPI

4 live tests against ViewSet::formodel(...).router(...) mounted in-process. Run with DATABASEURL=... cargo test --test cookbookchapter09viewsets --…

Chapter 9d — tenant_router for tenancy projects (v0.30, #80)

5 live tests against ViewSet::formodel(...).tenantrouter(...) mounted under a real TenantContext extension with header-based tenant resolution. Run with…

Chapter 10 — Templates + static

3 tests on the Tera template surface that the admin (Chapter 8) + operator console use. No DB needed. Run with cargo test --test…

Chapter 11 — Async / IO / extensions

Run with cargo test --test cookbookchapter11extensions.

Chapter 12 — Tri-dialect + cross-cutting

2 live tests against a docker MySQL 8.0 container, exercising the same cookbook model that PG tests use through the dialect-agnostic Pool + savepool /…

Chapter 13 — SQLite backend (v0.27 / v0.28)

v0.27 lights up SQLite as a third dialect alongside Postgres and MySQL. Same Pool enum, same pool ORM surface — the macro now emits FromRow<SqliteRow> +…

Chapter 14 — v0.30 cycle: do less work

The v0.30 release cycle (2026-05-08 → 2026-05-10) collapsed several common verb-chains and config writes into one-call APIs. Each recipe below maps a 4-5…

Chapter 15 — v0.31 — tenant admin no longer catches every URL

The big architectural fix this cycle. Through v0.30 the tenancy `server::Builder` attached the tenant admin as Router::fallbackservice(...) on the merged…

Chapter 16 — v0.38 — every feature, every backend

v0.38 is the "tri-dialect everywhere" release. Every framework surface that was previously PG-only now runs on PostgreSQL, MySQL

Chapter 17 — v0.43 — MCP server: expose tools to ML agents

The mcp feature turns a rustango app into a Model Context Protocol server: external ML agents authenticate as tenant-scoped identities, are granted skills…