django-lsp is a Rust language server focused on Django ORM query completions. It uses Ruff's
Python parser to build a static workspace index and follows Django model relations without importing
or executing the project.
from .models import Blog
Blog.objects.filter(author__team__name__icontains="Django")Install the language server from PyPI with uv:
uv tool install django-lsppipx install django-lsp and python -m pip install django-lsp are also supported. Confirm the
installed executable is available with:
django-lsp --versionPoint an editor's LSP client at the django-lsp command, with no arguments. The server uses standard
input and output for LSP communication.
The repository includes a Visual Studio Code extension that runs
django-lsp alongside Pylance, Pyright, Ruff, or another general Python language server. It uses a
configured executable, one already installed on PATH, or the executable bundled into a
platform-specific VSIX. See the extension README for development installation and packaging.
The repository includes a Zed extension that registers django-lsp
alongside a general Python language server. It uses a server already installed on PATH, or
downloads the matching executable from the latest GitHub release. See the extension README for
development installation while its extension-gallery submission is in progress.
- Getting started covers installing, building, and connecting an editor.
- Completion examples shows executable examples generated from the real LSP.
- Configuration documents
pyproject.tomloptions. - Testing explains the Rust, protocol, documentation, and Django compatibility test layers.
The website uses CrossDocs, the same documentation framework as Cross-Inertia. Preview the complete
FastAPI and React application locally at http://localhost:8000 with:
cd website
uv sync --locked
bun install --frozen-lockfile
bun run serve- workspace model indexing
- completion inside
filter(...),exclude(...),get(...),select_related(...), andprefetch_related(...) - forward, reverse, and recursive relation traversal
AUTH_USER_MODELsupport- models re-exported from package
__init__.pymodules - function-local and dotted import resolution
- unsaved editor buffer updates
Building from source requires Rust 1.95 or newer.
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo run --bin render-docs -- --check
cargo test --all-targetsValidate the documentation website separately with:
cd website
uv sync --locked
bun install --frozen-lockfile
bun run check
bun run buildThe project intentionally does not provide Django runtime introspection, general Python language features, or exhaustive support for dynamic model-loading patterns.