--- id: django-htmx version: "1.29.0" license: MIT license_treatment: permissive maintenance: active --- # django-htmx — Extensions for using Django with htmx. License: permissive · Maintenance: active · Downloads: 1.7M/mo ## What it is and what it does django-htmx bridges Django and htmx by providing server-side utilities to work with htmx's request patterns and response headers. It handles the integration layer that lets Django developers detect and respond to htmx requests, manage partial page updates, and leverage htmx's lightweight interactivity model within a Django application. The package sits between Django's request/response cycle and htmx's client-side behavior, offering helpers to inspect incoming htmx requests and craft appropriate responses. It depends on Django and asgiref, integrating naturally into existing Django projects without requiring external services or complex setup. Use it for: - Build dynamic form validation and submission without full page reloads using htmx and Django views - Implement progressive enhancement in Django templates by adding htmx attributes and handling partial renders - Create real-time UI updates in Django dashboards by responding to htmx swap requests - Add lightweight interactivity to Django applications without committing to a heavy JavaScript framework ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Django integration utilities for htmx, enabling server-side support for htmx attributes and request handling within Django applications. Yes. Active maintenance, no known vulnerabilities, permissive MIT license, and low install friction make it a safe choice. Suitable for Django projects targeting modern Python versions that want to integrate htmx without framework overhead. ## Install pip install django-htmx uv add django-htmx poetry add django-htmx ## Installing django-htmx Before you install: Low install friction with a pure Python wheel. Actively maintained with a release 9 days ago and 2003 repository stars. Requires Django and asgiref as runtime dependencies. License in practice: MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects. Quickstart: pip install django-htmx import django_htmx # In Django view, detect htmx requests if request.htmx: return render(request, 'partial.html') Requires Python 3.10 or later and Django 5.2+ as runtime dependencies. Verify before relying: - Specific htmx features or request attributes the package exposes beyond basic integration - Whether middleware is required or optional for core functionality - Performance characteristics when handling high-volume htmx requests ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django htmx integration, htmx django support, server-side htmx, django ajax with htmx, htmx request handling, django htmx extensions, htmx attributes django, django-integration, htmx, interactive-ui [View on SkillFed](https://skillfed.io/packages/django-htmx) · [View on PyPI](https://pypi.org/project/django-htmx/)