Integrations

There are several editor integrations built for djLint.

GitHub Actions

In a GitHub Actions workflow djLint reports each finding as an annotation, so it shows up inline on the diff of a pull request. No configuration is needed: djLint detects the workflow and switches output automatically.

- run: pip install djlint
- run: djlint . --lint --profile django

Use --no-github-output to get the plain console output instead, or --github-output to force annotations outside of Actions.

Annotations belong to one pull request. To keep findings in the repository’s Security tab, with history across runs, write them as SARIF and upload the file:

- run: djlint . --lint --sarif > djlint.sarif
  continue-on-error: true
- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: djlint.sarif

--sarif writes a SARIF 2.1.0 document to stdout and nothing else, so it can be redirected as above. Every enabled rule is listed with a link to its documentation, each finding carries its line and column, and with --check a file that would be reformatted is reported under a formatting rule. Azure DevOps, GitLab and most editors read the same format.

Pre-Commit

djLint can be used as a pre-commit hook as both a linter and a formatter.

The repo provides multiple pre-configured hooks for specific djLint profiles (it just pre-sets the --profile argument and tells pre-commit which file extensions to look for):

  • djlint for linting and djlint-reformat for formatting
    This will look for files matching *.html without setting --profile.
  • djlint-django and djlint-reformat-django
    This will look for files matching *.html and set --profile=django.
  • djlint-jinja and djlint-reformat-jinja
    This will look for files matching *.j2,*.jinja or *.jinja2 and set --profile=jinja.
  • djlint-nunjucks and djlint-reformat-nunjucks
    This will look for files matching *.njk and set --profile=nunjucks.
  • djlint-handlebars and djlint-reformat-handlebars
    This will look for files matching *.hbs and set --profile=handlebars.
  • djlint-liquid and djlint-reformat-liquid
    This will look for files matching *.html and set --profile=liquid.
  • djlint-golang and djlint-reformat-golang
    This will look for files matching *.tmpl and set --profile=golang.
  • djlint-tera and djlint-reformat-tera
    This will look for files matching *.html and set --profile=tera.
  • djlint-askama and djlint-reformat-askama
    This will look for files matching *.html and set --profile=askama.

Note that these predefined hooks are sometimes too conservative in the inputs they accept (your templates may be using a different extension) so pre-commit explicitly allows you to override any of these pre-defined options. See the pre-commit docs for additional configuration.

Default Django example

repos:
  - repo: https://github.com/djlint/djLint
    rev: v1.46.1
    hooks:
      - id: djlint-reformat-django
      - id: djlint-django

Handlebars with .html extension instead of .hbs

repos:
  - repo: https://github.com/djlint/djLint
    rev: v1.46.1
    hooks:
      - id: djlint-reformat-handlebars
        files: "\\.html"
        types_or: ["html"]
      - id: djlint-handlebars
        files: "\\.html"
        types_or: ["html"]

You can use the files or exclude parameters to constrain each hook to its own directory, allowing you to support multiple template languages within the same repo.

SublimeText Linter

djLint can be used as a SublimeText Linter plugin. It can be installed via package-control.

  1. cmd + shift + p
  2. Install SublimeLinter
  3. Install SublimeLinter-contrib-djlint

Ensure djLint is installed in your global python, or on your PATH.

Visual Studio Code

neovim

djLint can be used as linter and formatter in neovim.

Using none-ls plugin.

Using coc.nvim.

Using efm-langserver.

  1. Install efm-langserver and djLint with Mason via :MasonInstall efm djlint
  2. Add htmldjango to filetypes.
  3. Create format configuration:
local djlint = {
    formatCommand = "djlint --reformat --quiet --warn -",
    formatStdin = true,
}
  1. Connect language to formatter with htmldjango = { djlint }.

Sample configuration:

local djlint = {
    formatCommand = "djlint --reformat --quiet --warn -",
    formatStdin = true,
}

require("lspconfig").efm.setup({
    filetypes = { "htmldjango" },
    init_options = { documentFormatting = true },
    settings = {
        rootMarkers = { ".git/" },
        languages = {
            htmldjango = { djlint },
        },
    },
})

MegaLinter

djlint is natively embedded within the 100+ linters of MegaLinter

To install it, just run npx mega-linter-runner --install and follow instructions

Edit this page Updated Sep 9, 2026