# Install djhtml with Homebrew, Nix

Django/Jinja template indenter. Version 3.0.11 via Homebrew; verified from local package data. Also installable with nix: nix profile install nixpkgs#djhtml.

## Install

```sh
sudo av install brew:djhtml
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install djhtml
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#djhtml
```

  Evidence: nixpkgs package indexes: pkgs/by-name/dj/djhtml/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:djhtml
- **Package manager:** Homebrew
- **Version:** 3.0.11
- **Source summary:** Django/Jinja template indenter
- **Homepage:** <https://github.com/rtts/djhtml>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- djcss (alias)
- djhtml (alias)
- djjs (alias)
- djtxt (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 3.0.11
## Project history and usage

DjHTML is a pure-Python indenter for Django and Jinja templates, with companion commands for CSS, JavaScript, and text-like template files. It intentionally calls itself an indenter rather than a formatter: it changes leading whitespace but does not restructure markup.

### Project history

The official repository was created in May 2021 and describes DjHTML as a dependency-free template indenter. Its README positions the tool near formatters such as Black while making a narrower promise: fix indentation for already well-structured mixed HTML, CSS, JavaScript, Django, and Jinja templates.

DjHTML's design is conservative for template-heavy projects because it avoids inserting newlines or other non-whitespace characters. The same repository ships multiple entry points: `djhtml` for template files, `djcss` for style sections or CSS mode, `djjs` for script sections or JavaScript mode, and `djtxt` for text-oriented indentation.

### Adoption history

Adoption has been strongest in Python web projects that already use pre-commit. The README provides a `.pre-commit-config.yaml` example using the official repository as the hook source, which lets teams run DjHTML automatically without adding a broader HTML formatter to the application runtime.

Package-manager interest is modest but durable: the Homebrew package exposes the CLI tools for users who prefer system package managers, while the upstream project remains a small Python utility with regular 3.x releases.

### How it is used

Users run `djhtml template.html` or `djhtml .` to rewrite indentation, and use `--check` in automation when they want a nonzero status if files would change. The `fmt:off` and `fmt:on` markers, plus ignored pre/comment blocks, keep generated or intentionally odd sections out of the indenter.

### Why package nerds care

DjHTML is package-nerd interesting because it occupies the narrow space between no formatter and a full syntax-changing HTML formatter. Its no-dependency Python implementation, pre-commit hook, and separate mode commands make it a small, easy-to-package tool for template repositories.

### Timeline

- 2021-05-08: Official GitHub repository created.
- 2023-02: 3.0.x releases appear in official GitHub release metadata.
- 2026-03-26: 3.0.11 release published.

### Related projects

- Related template-formatting tools include djLint, djangofmt, Black for Python style culture, and pre-commit as the hook runner commonly used to apply DjHTML.

### Sources

- <https://github.com/rtts/djhtml>
- <https://raw.githubusercontent.com/rtts/djhtml/main/README.md>
- <https://api.github.com/repos/rtts/djhtml>
- <https://api.github.com/repos/rtts/djhtml/releases?per_page=10>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Other Package-Manager Records

- Nix - djhtml: normalized package name match | nixpkgs package indexes: pkgs/by-name/dj/djhtml/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/djhtml.yml](https://github.com/mxcl/pkgdb/blob/main/combined/djhtml.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
