Skip to main content

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")

Versions and migration

Django-ty 0.6.0 requires ty-extended>=0.87.0,<0.88.0. Companion versions are independent of official ty. Companion 0.87.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 151 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.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-ty 0.6.0
File Size Uploaded Provenance Actions
django_ty-0.6.0.tar.gz 237.1 kB Without provenance Details for django_ty-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-ty 0.6.0
File Interpreter ABI Platform Actions
django_ty-0.6.0-py3-none-any.whl Python 3 none any Details for django_ty-0.6.0-py3-none-any.whl

Total release size: 742.1 kB

Release files / django_ty-0.6.0.tar.gz

Download URL django_ty-0.6.0.tar.gz
Size 237.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8f39612d559bfe33875cef70f1a8d514a4fce62ae1e903ddf8dab592b19d79a2
BLAKE2b-256 checksum
How to use checksums
b4d37337a077030f7450aa8b9d8a3141b7df1a321a681bf7cb90e63853576ff7
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.6.0-py3-none-any.whl

Download URL django_ty-0.6.0-py3-none-any.whl
Size 505.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
019e271eb739a9ad5d800f466aa128b6e48eb87c75ccd2581d44ccb83fb4cbe0
BLAKE2b-256 checksum
How to use checksums
abe2639d6763c3209390db73ff583e42ccffcc13ec89353b60a2eb51869d03c7
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.6.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page