Skip to main content

djlintr

A fast HTML template linter and formatter. Port of djlint to Rust.

Currently only supports HTML and Django templates; Jinja2 and Nunjucks to be added in the future.

Installation

You can install djlintr directly from PyPI using pip or uv:

pip install djlintr
# or
uv pip install djlintr

Alternatively, you can grab one of the binary release files from GitHub.

Or, to install djlintr from source, ensure you have Rust installed and run:

cargo install --path .

Usage

djlintr [OPTIONS] <PATHS>...

Arguments

  • <PATHS>...: Files or directories to process.

Options

  • -r, --reformat: Reformat files.
  • -l, --lint: Lint files.
  • -e, --extension <EXTENSION>: File extensions to include (default: html).
  • -t, --threads <THREADS>: Number of threads to use.
  • --check: Return non-zero exit code if issues are found.
  • --max-attribute-length <MAX_ATTRIBUTE_LENGTH>: Maximum length for attributes before wrapping (default: 70).
  • --custom-blocks <CUSTOM_BLOCKS>: Comma-separated list of custom block tags.
  • -h, --help: Print help.
  • -V, --version: Print version.

Configuration

djlintr automatically searches for a .djlintrc (JSON) file or a pyproject.toml file in the current directory.

Supported Options

  • indent: Number of spaces for indentation (default: 4).
  • max_line_length: Maximum line length (default: 120).
  • max_attribute_length: Maximum length for attributes before wrapping (default: 70).
  • ignore: A list of rule codes to ignore.
  • custom_blocks: A list of custom block tags.

Python Compatibility Flags

djlintr aims for byte-for-byte parity with the original Python djlint. In a couple of places djlintr has a "better" implementation than the Python original, but defaults to reproducing the Python behaviour so that existing projects get identical output. These flags let you opt in to the improved (but intentionally non-identical) behaviour:

  • better_attribute_parsing (default: false): When false, djlintr uses the same attribute-matching regex as Python djlint, quirks and all. Set to true to use djlintr's cleaner attribute-parsing regex, which handles some edge cases more correctly but may produce output that differs from Python djlint.
  • require_closed_blocks (default: false): When false, djlintr indents the contents of a recognized block tag even when no explicit closing tag is present, matching Python djlint's lenient behaviour. Set to true to only indent blocks that have an explicit closing tag.

Example .djlintrc

{
  "indent": 2,
  "max_line_length": 100,
  "ignore": ["H006", "T001"]
}

Example pyproject.toml

djlintr supports both [tool.djlint] and [tool.djlintr] sections.

[tool.djlintr]
indent = 2
max_line_length = 100
ignore = ["H006", "T001"]

Metadata

Release files for djlintr 0.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djlintr 0.6.4
File Size Uploaded Provenance Actions
djlintr-0.6.4.tar.gz 115.3 kB With provenance Details for djlintr-0.6.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for djlintr 0.6.4
File Actions
djlintr-0.6.4-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for djlintr-0.6.4-py3-none-win_amd64.whl
djlintr-0.6.4-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details for djlintr-0.6.4-py3-none-manylinux_2_34_x86_64.whl
djlintr-0.6.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for djlintr-0.6.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
djlintr-0.6.4-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for djlintr-0.6.4-py3-none-macosx_11_0_arm64.whl
djlintr-0.6.4-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for djlintr-0.6.4-py3-none-macosx_10_12_x86_64.whl

Total release size: 7.0 MB

Release files / djlintr-0.6.4.tar.gz

Download URL djlintr-0.6.4.tar.gz
Size 115.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f828341b560b462ad641136089ba2349d6b026004b85f1c0e61548b2b4470219
BLAKE2b-256 checksum
How to use checksums
13c2f9e49589b2926583f4ca9f70bfbc6ebb2726bc1193b2daf9cf079702db73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / djlintr-0.6.4-py3-none-win_amd64.whl

Download URL djlintr-0.6.4-py3-none-win_amd64.whl
Size 1.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
29cc206b3aff44329f6ab121c046ae82d24de3dc07afbb3fb5d4f7bdfa44b0d9
BLAKE2b-256 checksum
How to use checksums
5ec17649ac908439c9c4eb414ee9af15c76e939c743bb804272aa12a7efd54fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / djlintr-0.6.4-py3-none-manylinux_2_34_x86_64.whl

Download URL djlintr-0.6.4-py3-none-manylinux_2_34_x86_64.whl
Size 1.5 MB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
2b7541a751047d39578332736532674856f6a747660b2dd59de1595f75547289
BLAKE2b-256 checksum
How to use checksums
b66e4d74dc6baf73eb1a53461abfb7ad55d5495f5e40a440d73de9125994aed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / djlintr-0.6.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL djlintr-0.6.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.4 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
c2bd153587c7067674076dcee5f40704973c8b42791be6f35047e02c68534ff4
BLAKE2b-256 checksum
How to use checksums
1fe03f0aa816689004ecb03f1aa746668ab99b86c1077242bebf2161abed95b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / djlintr-0.6.4-py3-none-macosx_11_0_arm64.whl

Download URL djlintr-0.6.4-py3-none-macosx_11_0_arm64.whl
Size 1.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5a4928a3c0f40d437d18ee49eb38380e569f896f421ae405a7883d6fc4365811
BLAKE2b-256 checksum
How to use checksums
49aa9339f102c7c7665e5239e989d12f8cfb6efc387384d43f026697a23a4090
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Release files / djlintr-0.6.4-py3-none-macosx_10_12_x86_64.whl

Download URL djlintr-0.6.4-py3-none-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
fbcc1fd2372479c0df9b9e1d7f70e106ab6ea9a3785018775989cb590f699e35
BLAKE2b-256 checksum
How to use checksums
a12192c887ef6c2990376ee7b92d14c6f31524215c49c2988bd852e50605917e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

Security for djlintr 0.6.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for djlintr-0.6.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page