Django template LSP
Project description
Django template LSP
A simple Django template LSP for completions that has support for:
- Custom
tags
andfilters
- templates for
extends
andincludes
- load tag
- static files
- urls
Support (tested)
- Python: 3.10, 3.11, 3.12
- Django: 3.2, 4.2, 5.0
Install
pip install django-template-lsp
Options
docker_compose_file
(string) default: "docker-compose.yml"docker_compose_service
(string) default: "django"django_settings_module
(string) default: ""
Type hints
Due to the highly dynamic nature of Python and Django, it can be challenging to identify the available context data within templates. To address this, basic type hint support is provided directly in the template files:
{# type blog: blogs.models.Blog #}
Note: Currently, this feature only supports Django models.
Editors
Helix
In your global or project languages.toml
add the following
[language-server.djlsp]
command = "djlsp"
[[language]]
name = "html"
language-servers = [ "vscode-html-language-server", "djlsp" ]
Project settings .helix/languages.toml
:
[language-server.djlsp.config]
django_settings_modules="<your.settings.module>"
Neovim
In your lspconfig add the following
require'lspconfig'.djlsp.setup{
cmd = { "<path-to-djlsp>" },
init_options = {
djlsp = {
django_settings_module = "<your.settings.module>"
docker_compose_file = "docker-compose.yml",
docker_compose_service = "django"
}
}
}
VSCode
To use the Django template LSP with VSCode read the following readme
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django_template_lsp-0.7.1.tar.gz
(25.6 kB
view hashes)
Built Distribution
Close
Hashes for django_template_lsp-0.7.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 219d81413813de0c4487e55b2e457a77f5021b92c8a94cd84b24e37f1e485a29 |
|
MD5 | afc1d1e0c7154e3c43c4edf39ee58df8 |
|
BLAKE2b-256 | 0a1cbcd97d834dec980721a0e359a8f50c46b0a7ea62135fb900229b03099aac |
Close
Hashes for django_template_lsp-0.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38ebd5fe20528b6a15b9ec53594f7fc86c265dce39552b067c0d13a90d0ecb46 |
|
MD5 | 190acc79b53936988a3eb4f1c027511d |
|
BLAKE2b-256 | f92435e1873b1e5fe5a271e1a94f0172de87d1504e2f956c36f454a5d84c079a |