djhtml
« Back to VersTracker
Description:
Django/Jinja template indenter
Type: Formula  |  Latest Version: 3.0.10@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: django jinja templates formatter indentation python
Install: brew install djhtml
About:
DjHTML is a versatile indenter for Django and Jinja templates that intelligently handles mixed HTML, CSS, and JavaScript code. Unlike generic formatters, it understands template syntax to correctly indent complex nested structures. This tool helps maintain clean, readable template files without manual formatting effort.
Key Features:
  • Handles mixed HTML, CSS, and JavaScript in templates
  • Preserves existing formatting where appropriate
  • Command-line interface for easy integration
  • Supports both Django and Jinja2 template syntax
Use Cases:
  • Automating template formatting in CI/CD pipelines
  • Cleaning up legacy Django/Jinja templates with inconsistent indentation
  • Enforcing consistent code style across template files
Alternatives:
  • djlint – djlint offers linting and formatting with more configuration options, while djhtml focuses specifically on indentation
  • prettier – Prettier handles HTML/CSS/JS but doesn't understand Django/Jinja template syntax
License: GPL-3.0-or-later
Dependencies: python@3.14
Bottles available for: all
Version History
Detected Version Rev Change Commit
Oct 8, 2025 1:58pm 0 VERSION_BUMP 00665f76
Oct 9, 2024 10:05pm 0 VERSION_BUMP b76485cd