Metadata-Version: 2.4
Name: django-lsp
Version: 0.1.3
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Rust
License-File: LICENSE
Summary: A language server for Django ORM query completions
Keywords: django,lsp,language-server,autocomplete
Home-Page: https://github.com/patrick91/django-lsp
License-Expression: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/patrick91/django-lsp/tree/main/docs
Project-URL: Issues, https://github.com/patrick91/django-lsp/issues
Project-URL: Repository, https://github.com/patrick91/django-lsp

# django-lsp

`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.

```python
from .models import Blog

Blog.objects.filter(author__team__name__icontains="Django")
```

## Installation

Install the language server from PyPI with `uv`:

```console
uv tool install django-lsp
```

`pipx install django-lsp` and `python -m pip install django-lsp` are also supported. Confirm the
installed executable is available with:

```console
django-lsp --version
```

Point an editor's LSP client at the `django-lsp` command, with no arguments. The server uses standard
input and output for LSP communication.

### Visual Studio Code

The repository includes a [Visual Studio Code extension](extensions/vscode-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.

### Zed

The repository includes a [Zed extension](extensions/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.

## Documentation

- [Getting started](docs/getting-started.md) covers installing, building, and connecting an editor.
- [Completion examples](docs/completions.md) shows executable examples generated from the real LSP.
- [Configuration](docs/configuration.md) documents `pyproject.toml` options.
- [Testing](docs/testing.md) explains the Rust, protocol, documentation, and Django compatibility
  test layers.
- [Documentation index](docs/README.md) provides the complete guide map.

## Current scope

- workspace model indexing
- completion inside `filter(...)`, `exclude(...)`, and `get(...)`
- forward, reverse, and recursive relation traversal
- `AUTH_USER_MODEL` support
- models re-exported from package `__init__.py` modules
- function-local and dotted import resolution
- unsaved editor buffer updates

## Development

Building from source requires Rust 1.95 or newer.

```console
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo run --bin render-docs -- --check
cargo test --all-targets
```

The project intentionally does not provide Django runtime introspection, general Python language
features, or exhaustive support for dynamic model-loading patterns.

