
django-stubs
PEP-484 stubs for Django
The Lens
Django leans hard on runtime magic. Models grow attributes you never declared, managers appear out of nowhere, Meta options reshape classes on the fly. That magic is also why a plain type checker throws up its hands on Django code. django-stubs is the fix: a full set of type hints plus a mypy plugin that actually understands the ORM, so your editor and your CI can catch a wrong field name or a bad query before it ships.
Setup is trivial. It is a dev dependency you pip install and a few lines of mypy config. Nothing to host, nothing to run in production. It tracks current Django and Python versions, and there is a sibling project, djangorestframework-stubs, if you live in DRF.
The whole thing is MIT and completely free. There is no paid tier and nothing gated. Solo devs, small teams, large teams: same deal, install it and move on. On Pyright instead of mypy you already get a lot of Django typing for free, so the value here is highest for mypy shops.
The catch is the coupling. The mypy plugin is tied to specific mypy and Django versions, so a major upgrade on either side can mean waiting for the stubs to catch up before your type check goes green again.
Free vs Self-Hosted vs Paid
fully freeFree / self-hosted: Everything. It is an MIT-licensed dev dependency you install with pip. No server, no account, no usage limits.
Paid: None. There is no commercial tier and no gated features. The project takes optional sponsorship through Open Collective, but nothing is held back for sponsors.
Completely free and open source. No paid tier.
Get tools like this every Wednesday
One featured tool, three on the radar. No fluff.
License: MIT License
Use freely, including commercial. Just keep the license.
Commercial use: ✓ Yes
About
- Owner
- TypedDjango (Organization)
- Stars
- 1,942
- Forks
- 562