django-language-server
A language server for the Django web framework.
New to language servers, or unsure whether you need one? Start with Why a language server?
[!CAUTION] This project is in early stages. ~~All~~ Most features are incomplete and missing.
Features
- [x] Completions - Template tag and filter autocompletion with snippets

- [x] Diagnostics - Real-time error checking and validation

- [x] Command-line checks - Validate template files and directories with
djls check - [x] Go to definition - Jump to template, block, and registered Python definitions
- [x] Template navigation for
{% extends %}and{% include %} - [x] Template Library, Tag, Filter, and selective-load symbol navigation
- [x] Exact source highlighting in editors that support definition links
- [x] Block definitions across template inheritance
- [ ] Variable definitions
- [x] Template navigation for
- [x] Find references - See where templates and inherited blocks are used
- [x] Template references for
{% extends %}and{% include %} - [x] Block references across template inheritance
- [ ] Variable references
- [x] Template references for
- [x] Document links - Click through resolved template references and template libraries
- [x] Template names in
{% extends %}and{% include %} - [x] Template libraries in
{% load %}
- [x] Template names in
- [x] Folding ranges - Fold Django template regions

- [x] Hover - View documentation for Django template tags, filters, libraries, and template references

- [x] Code actions - Quick fixes for unloaded tags or filters and mismatched closing block names
- [x] Formatting - Opt-in LSP document formatting through
djangofmt - [ ] Rename - Refactor names across files
- [x] Document symbols - Outline view of template structure
- [ ] Workspace symbols - Search across all project templates
- [ ] Signature help - Parameter hints while typing
Getting Started
Follow the getting started guide to go from nothing to a working setup: install the server, configure your editor, and open a template.
The short version:
uv tool install django-language-server
# or: pipx install django-language-server
Then set up your editor's LSP client to run the server:
- VS Code - Install the extension from the marketplace
- Neovim - Configure with
vim.lsp.config() - Sublime Text - Set up with LSP package
- Zed - Install the extension
Any other editor with an LSP client works too; see Editor setup. The Installation reference covers Homebrew, pip, standalone binaries, and source builds. The djls CLI can check templates without an editor.
Documentation
Visit djls.joshthomas.dev for full documentation including installation guides, configuration options, and editor setup instructions.
Contributing
See the contributor guide for development setup, testing, snapshots, and code-quality workflows.
License
django-language-server is licensed under the Apache License, Version 2.0. See the 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.