pax_global_header 0000666 0000000 0000000 00000000064 15064212514 0014512 g ustar 00root root 0000000 0000000 52 comment=788c1495389575e42221910fed1f072b414b5cb2
django-htmx-1.26.0/ 0000775 0000000 0000000 00000000000 15064212514 0014020 5 ustar 00root root 0000000 0000000 django-htmx-1.26.0/.editorconfig 0000664 0000000 0000000 00000000345 15064212514 0016477 0 ustar 00root root 0000000 0000000 # http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf
[*.py]
indent_size = 4
[Makefile]
indent_style = tab
django-htmx-1.26.0/.github/ 0000775 0000000 0000000 00000000000 15064212514 0015360 5 ustar 00root root 0000000 0000000 django-htmx-1.26.0/.github/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000000131 15064212514 0020152 0 ustar 00root root 0000000 0000000 This project follows [Django's Code of Conduct](https://www.djangoproject.com/conduct/).
django-htmx-1.26.0/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15064212514 0017543 5 ustar 00root root 0000000 0000000 django-htmx-1.26.0/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000034 15064212514 0021530 0 ustar 00root root 0000000 0000000 blank_issues_enabled: false
django-htmx-1.26.0/.github/ISSUE_TEMPLATE/feature-request.yml 0000664 0000000 0000000 00000000411 15064212514 0023403 0 ustar 00root root 0000000 0000000 name: Feature Request
description: Request an enhancement or new feature.
body:
- type: textarea
id: description
attributes:
label: Description
description: Please describe your feature request with appropriate detail.
validations:
required: true
django-htmx-1.26.0/.github/ISSUE_TEMPLATE/issue.yml 0000664 0000000 0000000 00000001526 15064212514 0021422 0 ustar 00root root 0000000 0000000 name: Issue
description: File an issue
body:
- type: input
id: python_version
attributes:
label: Python Version
description: Which version of Python were you using?
placeholder: 3.9.0
validations:
required: false
- type: input
id: django_version
attributes:
label: Django Version
description: Which version of Django were you using?
placeholder: 3.2.0
validations:
required: false
- type: input
id: package_version
attributes:
label: Package Version
description: Which version of this package were you using? If not the latest version, please check this issue has not since been resolved.
placeholder: 1.0.0
validations:
required: false
- type: textarea
id: description
attributes:
label: Description
description: Please describe your issue.
validations:
required: true
django-htmx-1.26.0/.github/SECURITY.md 0000664 0000000 0000000 00000000101 15064212514 0017141 0 ustar 00root root 0000000 0000000 Please report security issues directly over email to me@adamj.eu
django-htmx-1.26.0/.github/dependabot.yml 0000664 0000000 0000000 00000000247 15064212514 0020213 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
groups:
"GitHub Actions":
patterns:
- "*"
schedule:
interval: monthly
django-htmx-1.26.0/.github/workflows/ 0000775 0000000 0000000 00000000000 15064212514 0017415 5 ustar 00root root 0000000 0000000 django-htmx-1.26.0/.github/workflows/main.yml 0000664 0000000 0000000 00000005007 15064212514 0021066 0 ustar 00root root 0000000 0000000 name: CI
on:
push:
branches:
- main
tags:
- '**'
pull_request:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-24.04
strategy:
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Run tox targets for ${{ matrix.python-version }}
run: uvx --with tox-uv tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.python-version }}
path: '${{ github.workspace }}/.coverage.*'
include-hidden-files: true
if-no-files-found: error
coverage:
name: Coverage
runs-on: ubuntu-24.04
needs: tests
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: uv pip install --system coverage[toml]
- name: Download data
uses: actions/download-artifact@v5
with:
path: ${{ github.workspace }}
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage and fail if it's <100%
run: |
python -m coverage combine
python -m coverage html --skip-covered --skip-empty
python -m coverage report --fail-under=100
echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY
python -m coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
- name: Upload HTML report
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
release:
needs: [coverage]
if: success() && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-24.04
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
- name: Build
run: uv build
- uses: pypa/gh-action-pypi-publish@release/v1
django-htmx-1.26.0/.gitignore 0000664 0000000 0000000 00000000135 15064212514 0016007 0 ustar 00root root 0000000 0000000 *.egg-info/
*.pyc
/.coverage
/.coverage.*
/.tox
/build/
/dist/
/docs/_build/
/example/.venv/
django-htmx-1.26.0/.pre-commit-config.yaml 0000664 0000000 0000000 00000004413 15064212514 0020303 0 ustar 00root root 0000000 0000000 ci:
autoupdate_schedule: monthly
default_language_version:
python: python3.13
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: end-of-file-fixer
exclude: |
(?x)^(
example/example/static/ext/debug\.js
|src/django_htmx/static/django_htmx/htmx\.min\.js
)$
- id: trailing-whitespace
- repo: https://github.com/crate-ci/typos
rev: edb4e206047e89b93ebe08f1a2ccc3d581a70cc7 # frozen: v1
hooks:
- id: typos
exclude: |
(?x)^(
.*\.min\.js
|.*\.svg
)$
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 8184a5b72f4a8fcd003b041ecb04c41a9f34fd2b # frozen: v2.6.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 4e2cb0e98735e1a57a027d9440b91663e31d10b0 # frozen: 1.6.0
hooks:
- id: tox-ini-fmt
- repo: https://github.com/rstcheck/rstcheck
rev: 27258fde1ee7d3b1e6a7bbc58f4c7b1dd0e719e5 # frozen: v6.2.5
hooks:
- id: rstcheck
additional_dependencies:
- sphinx==8.1.3
- tomli==2.2.1
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: ff671d6a030a3141634793e6d1e8909ab6091830 # frozen: v1.0.0
hooks:
- id: sphinx-lint
- repo: https://github.com/adamchainz/django-upgrade
rev: 801c22cf0b32793544572cb0a81655e51879f561 # frozen: 1.27.0
hooks:
- id: django-upgrade
- repo: https://github.com/adamchainz/blacken-docs
rev: 78a9dcbecf4f755f65d1f3dec556bc249d723600 # frozen: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies:
- black==25.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: db90487f48a9dd992d243ef63c156eaffddeaf28 # frozen: v0.12.11
hooks:
- id: ruff-check
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 412de98d50e846f31ea6f4b0ad036f2c24a7a024 # frozen: v1.17.1
hooks:
- id: mypy
additional_dependencies:
- django-stubs==5.1.2
- types-python-dateutil
- repo: https://github.com/adamchainz/djade-pre-commit
rev: 097fdcef353da8e007b548283e95dd2d21a11166 # frozen: 1.5.0
hooks:
- id: djade
django-htmx-1.26.0/.readthedocs.yaml 0000664 0000000 0000000 00000001107 15064212514 0017246 0 ustar 00root root 0000000 0000000 # .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
build:
os: ubuntu-24.04
tools:
python: "3.13"
jobs:
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
sphinx:
configuration: docs/conf.py
fail_on_warning: true
formats: all
django-htmx-1.26.0/.typos.toml 0000664 0000000 0000000 00000000413 15064212514 0016147 0 ustar 00root root 0000000 0000000 # Configuration file for 'typos' tool
# https://github.com/crate-ci/typos
[default]
extend-ignore-re = [
# Single line ignore comments
"(?Rm)^.*(#|//)\\s*typos: ignore$",
# Multi-line ignore comments
"(?s)(#|//)\\s*typos: off.*?\\n\\s*(#|//)\\s*typos: on"
]
django-htmx-1.26.0/HISTORY.rst 0000664 0000000 0000000 00000000100 15064212514 0015702 0 ustar 00root root 0000000 0000000 See https://django-htmx.readthedocs.io/en/latest/changelog.html
django-htmx-1.26.0/LICENSE 0000664 0000000 0000000 00000002055 15064212514 0015027 0 ustar 00root root 0000000 0000000 MIT License
Copyright (c) 2020 Adam Johnson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
django-htmx-1.26.0/MANIFEST.in 0000664 0000000 0000000 00000000154 15064212514 0015556 0 ustar 00root root 0000000 0000000 include LICENSE
include pyproject.toml
include README.rst
include src/*/py.typed
recursive-include src *.js
django-htmx-1.26.0/README.rst 0000664 0000000 0000000 00000002405 15064212514 0015510 0 ustar 00root root 0000000 0000000 ===========
django-htmx
===========
.. image:: https://img.shields.io/readthedocs/django-htmx?style=for-the-badge
:target: https://django-htmx.readthedocs.io/en/latest/
.. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/django-htmx/main.yml.svg?branch=main&style=for-the-badge
:target: https://github.com/adamchainz/django-htmx/actions?workflow=CI
.. image:: https://img.shields.io/badge/Coverage-100%25-success?style=for-the-badge
:target: https://github.com/adamchainz/django-htmx/actions?workflow=CI
.. image:: https://img.shields.io/pypi/v/django-htmx.svg?style=for-the-badge
:target: https://pypi.org/project/django-htmx/
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge
:target: https://github.com/psf/black
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit
----
.. figure:: https://raw.githubusercontent.com/adamchainz/django-htmx/main/docs/_static/logo.svg
:alt: django-htmx logo
:align: center
Extensions for using Django with `htmx `__.
Documentation
-------------
Please see https://django-htmx.readthedocs.io/.
django-htmx-1.26.0/docs/ 0000775 0000000 0000000 00000000000 15064212514 0014750 5 ustar 00root root 0000000 0000000 django-htmx-1.26.0/docs/Makefile 0000664 0000000 0000000 00000001177 15064212514 0016416 0 ustar 00root root 0000000 0000000 # Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= "-W"
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
django-htmx-1.26.0/docs/_static/ 0000775 0000000 0000000 00000000000 15064212514 0016376 5 ustar 00root root 0000000 0000000 django-htmx-1.26.0/docs/_static/logo.svg 0000664 0000000 0000000 00000026373 15064212514 0020072 0 ustar 00root root 0000000 0000000
django-htmx-1.26.0/docs/changelog.rst 0000664 0000000 0000000 00000024022 15064212514 0017431 0 ustar 00root root 0000000 0000000 =========
Changelog
=========
1.26.0 (2025-09-22)
-------------------
* The :ref:`django-htmx-extension-script` now displays responses with status codes 400 (bad request) and 403 (forbidden), like the existing support for codes 404 and 500.
This change can help you debug
`Issue #521 `__.
* Add :func:`.reselect` to set the ``HX-Reselect`` header.
`Issue #559 `__.
* Improve typing of :func:`.reswap` to only accept valid HTMX swap methods.
Thanks to Thibaut Decombe in `PR #555 `__.
* Prevent :class:`.HttpResponseClientRedirect` from being called with ``preserve_request=True``, which was added to `redirect responses `__ in Django 5.2.
It doesn’t make sense in the context of a client-side redirect, which always returns a status code of 200, and would crash anyway.
`Issue #517 `__.
1.25.0 (2025-09-18)
-------------------
* Support Django 6.0.
* Add CSP nonce support to the template tags.
Thanks to waifudegen for the report in `Issue #542 `__.
1.24.1 (2025-09-11)
-------------------
* Upgrade the vendored htmx to `version 2.0.7 `__.
1.24.0 (2025-09-10)
-------------------
* Support Python 3.14.
* Fix crashes in the extension script for custom error pages.
Thanks to S Foster for the report in `Issue #546 `__.
1.23.2 (2025-06-27)
-------------------
* Upgrade the vendored htmx to `version 2.0.6 `__.
1.23.1 (2025-06-21)
-------------------
* Upgrade the vendored htmx to `version 2.0.5 `__.
1.23.0 (2025-03-14)
-------------------
* Vendor htmx.
You can now render an htmx script tag in your templates with:
.. code-block:: django
{% load django_htmx %}
{% htmx_script %}
No need to include htmx in your project separately.
See :doc:`template_tags` for more information.
1.22.0 (2025-02-06)
-------------------
* Support Django 5.2.
1.21.0 (2024-10-27)
-------------------
* Drop Django 3.2 to 4.1 support.
1.20.0 (2024-10-25)
-------------------
* Drop Python 3.8 support.
* Support Python 3.13.
* Updated :ref:`the partial rendering tip ` to cover using django-template-partials.
Thanks to Carlton Gibson in `PR #413 `__.
1.19.0 (2024-08-05)
-------------------
* Add :func:`django_htmx.http.replace_url` for setting the ``HX-Replace-URL`` header.
Thanks to Bogumil Schube in `PR #396 `__.
* Add ``select`` parameter to :class:`.HttpResponseLocation`.
Thanks to Nikola Anović in `PR #462 `__.
* Add documentation notes under :class:`.HtmxMiddleware`, covering setting the ``Vary`` header for caching and type hinting ``request.htmx``.
1.18.0 (2024-06-19)
-------------------
* Support Django 5.1.
1.17.3 (2024-03-01)
-------------------
* Change ``reswap()`` type hint for ``method`` to ``str``.
Thanks to Dan Jacob for the report in `Issue #421 `__ and fix in `PR #422 `__.
1.17.2 (2023-11-16)
-------------------
* Fix asgiref dependency declaration.
1.17.1 (2023-11-14)
-------------------
* Fix ASGI compatibility on Python 3.12.
Thanks to Grigory Vydrin for the report in `Issue #381 `__.
1.17.0 (2023-10-11)
-------------------
* Support Django 5.0.
1.16.0 (2023-07-10)
-------------------
* Drop Python 3.7 support.
* Remove the unnecessary ``type`` attribute on the ``
{% django_htmx_script %}
...