Metadata-Version: 2.4
Name: django-language-server
Version: 6.0.3
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
License-File: LICENSE
Summary: A language server for the Django web framework
Author-email: Josh Thomas <josh@joshthomas.dev>
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://django-language-server.readthedocs.io/
Project-URL: Issues, https://github.com/joshuadavidthomas/django-language-server/issues
Project-URL: Source, https://github.com/joshuadavidthomas/django-language-server

# django-language-server

<!-- [[[cog
import subprocess
import cog

from noxfile import DJ_VERSIONS
from noxfile import PY_VERSIONS
from noxfile import display_version

django_versions = [display_version(version) for version in DJ_VERSIONS]

cog.outl("[![PyPI](https://img.shields.io/pypi/v/django-language-server)](https://pypi.org/project/django-language-server/)")
cog.outl("![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-language-server)")
cog.outl(f"![Django Version](https://img.shields.io/badge/django-{'%20%7C%20'.join(django_versions)}-%2344B78B?labelColor=%23092E20)")
]]] -->
[![PyPI](https://img.shields.io/pypi/v/django-language-server)](https://pypi.org/project/django-language-server/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-language-server)
![Django Version](https://img.shields.io/badge/django-5.2%20%7C%206.0%20%7C%20main-%2344B78B?labelColor=%23092E20)
<!-- [[[end]]] -->

A language server for the Django web framework.

> [!CAUTION]
> This project is in early stages. ~~All~~ Most features are incomplete and missing.

## Features

- [x] **Completions** - Template tag and filter autocompletion with snippets
  ![Completions](docs/assets/autocomplete.png)
- [x] **Diagnostics** - Real-time error checking and validation
  ![Diagnostics](docs/assets/diagnostics.png)
- [ ] **Go to definition** - Jump to template, block, or variable definitions
    - [x] Template navigation for `{% extends %}` and `{% include %}`
    - [ ] Block and variable definitions
- [ ] **Find references** - See where templates, blocks, and variables are used
    - [x] Template references for `{% extends %}` and `{% include %}`
    - [ ] Block and variable references
- [x] **Folding ranges** - Fold Django template regions
  ![Folding ranges](docs/assets/folding.png)
- [x] **Hover** - View documentation for Django template tags, filters, libraries, and template references
  ![Hover tag](docs/assets/hover-tag.png)
  ![Hover filter](docs/assets/hover-filter.png)
  ![Hover template](docs/assets/hover-template.png)
- [ ] **Rename** - Refactor names across files
- [ ] **Code actions** - Quick fixes and refactorings
- [x] **Document symbols** - Outline view of template structure
- [ ] **Workspace symbols** - Search across all project templates
- [ ] **Signature help** - Parameter hints while typing

## Getting Started

Set up your editor's LSP client to run the server:

- [VS Code](docs/clients/vscode.md) - Install the extension from the marketplace
- [Neovim](docs/clients/neovim.md) - Configure with `vim.lsp.config()`
- [Sublime Text](docs/clients/sublime-text.md) - Set up with LSP package
- [Zed](docs/clients/zed.md) - Install the extension

See [all client configurations](docs/clients/index.md).

Most editors can use `uvx --from django-language-server djls serve` to run the server on-demand without installing it. Alternatively, install it globally first:

```bash
uv tool install django-language-server
# or: pipx install django-language-server
```

See the [Installation](docs/installation.md) guide for more options including pip, standalone binaries, and building from source.

Once configured, open any Django template file in your project to get:

- Template tag and filter completions with snippets
- Real-time syntax validation and diagnostics
- Hover documentation for template tags, filters, libraries, and template references
- Navigation to template definitions and references
- Folding for Django template regions
- Outline symbols for template structure

## Documentation

Visit [djls.joshthomas.dev](https://djls.joshthomas.dev) for full documentation including installation guides, configuration options, and editor setup instructions.

## License

django-language-server is licensed under the Apache License, Version 2.0. See the [`LICENSE`](LICENSE) file for more information.

---

django-language-server is not associated with the Django Software Foundation.

Django is a registered trademark of the Django Software Foundation.

