Python
Python on the backend: static typing, ORMs and Django in production.
- Development
A typed ORM without code generation
How to make mypy and Pyright understand a Python ORM without code generation or plugins: descriptors with overloaded __get__, generics and dataclass_transform.
- Development
How I organise a growing Python project: the same structure in Django and Flask
The structure I use for Django and Flask projects that grow: domain, services, selectors and use cases to serve HTML and JSON at the same time.
- Development › Django
N+1 queries in Django: from 101 queries to 1
How to find and fix N+1 queries in Django step by step: from 101 queries to 1 with debug-toolbar, select_related, prefetch_related and annotate.
- Development › Django
Multi-tenancy in Django: four strategies
Four ways to isolate SaaS customers in Django: separate databases, hybrid, schema per tenant and tenant_id, with the trade-offs and when to use each one.
- Development › Flask
Setting up your Flask: the essential dependencies for an SSR or API project
What I install in Flask to get what Django ships with: ORM, migrations, forms, CSRF, login and i18n, for SSR with Jinja or for a JSON API.
- Development › Strict Python
Strict Python: the tools that warn you before production
The tools that make a Python project fail before production: uv, Ruff, mypy and Pyright, type tests, Hypothesis, coverage, deptry and the CI matrix.
- Development › Strict Python
Ruff in depth: which rules to enable and how not to run three versions
Which Ruff rule families to enable, safe and unsafe fixes, per-folder exceptions and how to avoid running three different Ruff versions in one project.
- Development › Strict Python
mypy and Pyright in depth: strict mode without surprises
What mypy --strict turns on, the cache, Pyright and its modes, running both at once, where to relax without giving up, and what Python 3.14 annotations changed.
- Development › Strict Python
A typed Django ORM: what the type checker sees and what it does not
What mypy and Pyright understand of the Django ORM with django-stubs: the plugin, QuerySet[Model], annotate() and values() with TypedDict, and no plugin.
- Development › Strict Python
Type tests: making the types say what they promise
How to prove your types accept what is right and reject what is wrong: assert_type, expected errors, and mypy and Pyright run from pytest.
- Development › Strict Python
pytest in depth: from fixtures to tests that fail sometimes
pytest beyond the basics: typed fixtures, pytest-django, Hypothesis with st.data(), Playwright without fixed waits, and warnings that sneak into your tests.
- Development › Strict Python
Mutation testing: the test that tests your tests
Why 100 % coverage is not enough: mutation testing with mutmut, a real surviving mutant, and how to split it in CI with parallel shards and a cache.
Showing 1–12 of 13