django-ty
django-ty adds Django ORM semantics through the ty-extended Monty companion.
The companion delegates to unchanged official Astral ty; it is not a fork of the checker.
Django's hooks and static API ship in one universal Python wheel. Consumers do not
build Rust, install WASM artifacts or run a Python worker.
Install and check
uv add django-ty
Enable installed plugin discovery in your project:
[tool.ty.plugins]
auto-discover = true
uv run ty-extended check .
For an explicit Django settings module:
uv run python -m django_ty --settings-module project.settings check .
The module launcher resolves the installed companion directly, including when its
executable is absent from PATH. No installer command, .ty directory or file copy is required.
Editors
Start ty-extended server and enable workspace diagnostics. Django's project
index needs closed model modules to provide reverse relations and cross-module
queryset annotations. openFilesOnly limits those facts in both the former checker
and the companion.
For the official VS Code extension, use a trusted workspace and configure:
{
"ty.path": ["/absolute/project/.venv/bin/ty-extended"],
"ty.diagnosticMode": "workspace"
}
On Windows, select .venv/Scripts/ty-extended.exe. With Neovim 0.11 or later:
vim.lsp.config("ty", {
cmd = { "/absolute/project/.venv/bin/ty-extended", "server" },
settings = { ty = { diagnosticMode = "workspace" } },
})
vim.lsp.enable("ty")
Performance
Django-ty 0.7 uses class-specific project indexes, bounded class batches and
read-only lookups in companion 0.89. Model relations within a split models package resolve across
sibling modules. See the performance comparison
for fresh-process MyPy and bare-ty benchmarks with ORM and ordinary Python error
controls, and the Monty guide for the
installed large-project regression.
On the recorded macOS workload with 7,082 Python files, 2,501 related models and 100 ORM type assertions, the published 0.89 companion with the Django-ty 0.7 candidate wheel takes a median 6.59 seconds, down from 80.79 seconds with Django-ty 0.6 and companion 0.87. MyPy with django-stubs takes 6.81 seconds on the same files; bare official ty takes 0.27 seconds. All five public-companion workloads meet the MyPy median ceiling. The largest Mac case is close to parity; smaller projects show larger advantages. These are five rotated fresh-process runs with exact ORM assertions, both negative controls and unchanged source bytes. The qualification receipt identifies the executables and every sample; Django's published wheel is verified separately.
Versions and migration
Django-ty 0.7.0 requires ty-extended>=0.89.0,<0.90.0. Companion versions are
independent of official ty. Companion 0.89.0 was qualified against every ty release
from 0.0.84 through 0.0.99; its dependency range is ty>=0.0.84,<0.1. Future versions
within that range are accepted but need compatibility checks. An ordinary ty update
within a compatible group does not require another Django-ty release.
Django 5.0 through 6.1 and Python 3.10 or later are accepted. The compatibility matrix records 21 complete Django/Python pairs, each with 166 official-contract assertions, 83 independent runtime contracts and nine QueryDict cases. Django 6.1.3 on Python 3.15 has an additional contract and runtime qualification; the pinned mypy comparator does not declare support for that Python version. See the Monty guide for the evidence and reproduction commands.
Versions through 0.5.0 depended on a checker distribution that owned the ty
namespace. Remove it before installing the new stack:
uv remove django-ty
uv add django-ty
uv run ty --version
uv run ty-extended --version
If you declared ty-extended separately, remove that old dependency too before
adding Django-ty again. For pip environments, uninstall django-ty and ty-extended
first, then install django-ty and reinstall official ty.
Change plugin-enabled commands and editor launchers from ty to ty-extended.
The --runtime monty option remains accepted; WASM selection is no longer supported.
Coverage and qualification
The complete pinned Django static API is packaged in the wheel. No upstream
django-stubs, django-stubs-ext or mypy-plugin distribution is installed.
Django-ty covers model fields, relations, managers, queryset results, values(),
values_list(), basic annotate(), literal lookups and model ID state across
construction, loading, saving, deletion, aliases and branches. WithAnnotations
and other django-stubs-ext utilities remain outside the product surface.
Django documentation and the installed framework define expected behavior. Mypy is a comparison tool; reviewed disagreements have version-specific references and runtime evidence in the disagreement audit. The coverage map is generated from the same checks.
Installed-wheel CI tests automatic discovery, the module launcher, an empty PATH,
positive and negative typing controls, real LSP configuration, field hover, unsaved
errors, restoration and source preservation on Linux, macOS and Windows. A bounded
7,082-file/2,501-model regression checks both valid and invalid assignments. These
results qualify the recorded corpus and generated workload, not every private application.
Development
python3 scripts/build-monty.py --check
bash scripts/build-wheel.sh
uv run --no-project --python 3.11 python scripts/evaluate_django_stubs_coverage.py --check
uv run --no-project --python 3.11 python -m unittest discover -s tests
bash scripts/differential-conformance.sh --check
uv run --no-project --python 3.11 python scripts/probe_django_versions.py --check --clean-environments
bash scripts/e2e.sh
The Rust crate is an independent development oracle. Its tests and 98% coverage gate remain in CI; it is not part of the consumer build. Native test artifacts are cleaned after each phase. The Python implementation also matches 152 native regression responses through CPython and Monty 1.5.0. Consumers use the companion's embedded runtime and do not depend on that separate development interpreter.
License
MIT (LICENSE). Contributions are licensed under the same terms.
Metadata
Release files for django-ty 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_ty-0.7.0.tar.gz | 238.7 kB | Without provenance | Details for django_ty-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_ty-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for django_ty-0.7.0-py3-none-any.whl |
Total release size: 745.3 kB
Release files / django_ty-0.7.0.tar.gz
| Download URL | django_ty-0.7.0.tar.gz |
|---|---|
| Size | 238.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a60151a7e92611f4ca851fb153229c595ddb06e39a5e507a2f1432a7acc3bcf5
|
|
BLAKE2b-256 checksum How to use checksums |
45448a5069f10ac2f2d2b76f024a645fc26d7c1f0812f2dff5ad82665ce626cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / django_ty-0.7.0-py3-none-any.whl
| Download URL | django_ty-0.7.0-py3-none-any.whl |
|---|---|
| Size | 506.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d3f9850a62090527de9748559541030a4addb185b67ccbbe52e7ccfc1bc3a2e
|
|
BLAKE2b-256 checksum How to use checksums |
d412d4bb58d43d6b7f58a7e1d0e334fee79a2ce630b4ed980764f680e58bac11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for django-ty 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.