Skip to content

Jinja template linter and formatter

djLint lints and formats Jinja templates. Set the jinja profile so the rules and the formatting fit them.

What is Jinja?

MiniJinja follows Jinja2’s syntax, and HubSpot’s Jinjava templates are Jinja-style too, so use the jinja profile for both. J004 and J018 suggest Flask’s url_for, so ignore them in a project without Flask.

Terminal window
djlint /path/to/templates --profile=jinja

Configure djLint in your project’s pyproject.toml, djlint.toml / .djlint.toml, or .djlintrc file.

pyproject.toml
[tool.djlint]
profile = "jinja"
djlint.toml / .djlint.toml
profile = "jinja"
.djlintrc
{ "profile": "jinja" }