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 #}
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.8.0.tar.gz
(25.9 kB
view hashes)
Built Distribution
Close
Hashes for django_template_lsp-0.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 143c5a423f6859d4c0bc5f5c4f0ad11646a2e196907a6f8e9bc95882a070e829 |
|
MD5 | 5e0fb5e86bc6ce30bd26e5519134f4cb |
|
BLAKE2b-256 | aa9573af0a09e731feac68fb4da7572f80cccbca543c5371f5c7c27a867a4c87 |
Close
Hashes for django_template_lsp-0.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc654302249067063d86ae7fc5dd1a0d8d56c0ac55f3d36bf611fb043144cbf4 |
|
MD5 | a1b15c523564e42940a7372f6a42d922 |
|
BLAKE2b-256 | 5b046b4e5fb82acd417e8c99c5cea39b895c7e7928deb5be69180df1aa6faa02 |