pax_global_header 0000666 0000000 0000000 00000000064 15112426617 0014517 g ustar 00root root 0000000 0000000 52 comment=7416a03816ed7478beafbb55d296591278e08059
django-htmx-1.27.0/ 0000775 0000000 0000000 00000000000 15112426617 0014026 5 ustar 00root root 0000000 0000000 django-htmx-1.27.0/.editorconfig 0000664 0000000 0000000 00000000345 15112426617 0016505 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.27.0/.github/ 0000775 0000000 0000000 00000000000 15112426617 0015366 5 ustar 00root root 0000000 0000000 django-htmx-1.27.0/.github/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000000131 15112426617 0020160 0 ustar 00root root 0000000 0000000 This project follows [Django's Code of Conduct](https://www.djangoproject.com/conduct/).
django-htmx-1.27.0/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15112426617 0017551 5 ustar 00root root 0000000 0000000 django-htmx-1.27.0/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000034 15112426617 0021536 0 ustar 00root root 0000000 0000000 blank_issues_enabled: false
django-htmx-1.27.0/.github/ISSUE_TEMPLATE/feature-request.yml 0000664 0000000 0000000 00000000411 15112426617 0023411 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.27.0/.github/ISSUE_TEMPLATE/issue.yml 0000664 0000000 0000000 00000001527 15112426617 0021431 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.14.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.27.0/.github/SECURITY.md 0000664 0000000 0000000 00000000101 15112426617 0017147 0 ustar 00root root 0000000 0000000 Please report security issues directly over email to me@adamj.eu
django-htmx-1.27.0/.github/dependabot.yml 0000664 0000000 0000000 00000000247 15112426617 0020221 0 ustar 00root root 0000000 0000000 version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
groups:
"GitHub Actions":
patterns:
- "*"
schedule:
interval: monthly
django-htmx-1.27.0/.github/workflows/ 0000775 0000000 0000000 00000000000 15112426617 0017423 5 ustar 00root root 0000000 0000000 django-htmx-1.27.0/.github/workflows/main.yml 0000664 0000000 0000000 00000004767 15112426617 0021110 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.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
uses: astral-sh/setup-uv@v7
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@v5
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@v6
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv pip install --system coverage[toml]
- name: Download data
uses: actions/download-artifact@v6
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@v5
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@v7
- name: Build
run: uv build
- uses: pypa/gh-action-pypi-publish@release/v1
django-htmx-1.27.0/.gitignore 0000664 0000000 0000000 00000000135 15112426617 0016015 0 ustar 00root root 0000000 0000000 *.egg-info/
*.pyc
/.coverage
/.coverage.*
/.tox
/build/
/dist/
/docs/_build/
/example/.venv/
django-htmx-1.27.0/.pre-commit-config.yaml 0000664 0000000 0000000 00000004413 15112426617 0020311 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: b04a3e939a8f2800a1dc330d7e569e7557879d41 # frozen: v1
hooks:
- id: typos
exclude: |
(?x)^(
.*\.min\.js
|.*\.svg
)$
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 68b1ed526e7533ac54a2e42874b99ae6c26807a2 # frozen: v2.11.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: be26ee0d710a48f7c1acc1291d84082036207bd3 # frozen: 1.7.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: e24bb0e1a3d80232373e49ca855721ec44e6340f # frozen: v1.0.1
hooks:
- id: sphinx-lint
- repo: https://github.com/adamchainz/django-upgrade
rev: 553731fe59437e0bd2cf18b10144116422bed259 # frozen: 1.29.1
hooks:
- id: django-upgrade
- repo: https://github.com/adamchainz/blacken-docs
rev: dda8db18cfc68df532abf33b185ecd12d5b7b326 # frozen: 1.20.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==25.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: aad66557af3b56ba6d4d69cd1b6cba87cef50cbb # frozen: v0.14.3
hooks:
- id: ruff-check
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 9f70dc58c23dfcca1b97af99eaeee3140a807c7e # frozen: v1.18.2
hooks:
- id: mypy
additional_dependencies:
- django-stubs==5.1.2
- types-python-dateutil
- repo: https://github.com/adamchainz/djade-pre-commit
rev: 47481957f135f6af9121b2af9c415155d260cc8e # frozen: 1.6.0
hooks:
- id: djade
django-htmx-1.27.0/.readthedocs.yaml 0000664 0000000 0000000 00000001107 15112426617 0017254 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.14"
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.27.0/.typos.toml 0000664 0000000 0000000 00000000413 15112426617 0016155 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.27.0/HISTORY.rst 0000664 0000000 0000000 00000000100 15112426617 0015710 0 ustar 00root root 0000000 0000000 See https://django-htmx.readthedocs.io/en/latest/changelog.html
django-htmx-1.27.0/LICENSE 0000664 0000000 0000000 00000002055 15112426617 0015035 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.27.0/MANIFEST.in 0000664 0000000 0000000 00000000154 15112426617 0015564 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.27.0/README.rst 0000664 0000000 0000000 00000002405 15112426617 0015516 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.27.0/docs/ 0000775 0000000 0000000 00000000000 15112426617 0014756 5 ustar 00root root 0000000 0000000 django-htmx-1.27.0/docs/Makefile 0000664 0000000 0000000 00000001177 15112426617 0016424 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.27.0/docs/_static/ 0000775 0000000 0000000 00000000000 15112426617 0016404 5 ustar 00root root 0000000 0000000 django-htmx-1.27.0/docs/_static/logo.svg 0000664 0000000 0000000 00000026373 15112426617 0020100 0 ustar 00root root 0000000 0000000
django-htmx-1.27.0/docs/changelog.rst 0000664 0000000 0000000 00000024423 15112426617 0017444 0 ustar 00root root 0000000 0000000 =========
Changelog
=========
1.27.0 (2025-11-28)
-------------------
* Drop Python 3.9 support.
* Fix CSP nonce support in the template tags when they’re the first use of ``csp_nonce``.
`PR #572 `__.
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 Content Security Policy (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 %}
...