Extension Script ================ django-htmx comes with a small JavaScript extension for htmx’s behaviour. Currently the extension only includes a debug error handler, documented below. Installation ------------ The script is served as a static file called ``django-htmx.js``, but you shouldn't reference it directly. Instead, use the included template tags, for both Django and Jinja templates. Django Templates ^^^^^^^^^^^^^^^^ Load and use the template tag in your base template, after your htmx ``{# or however you include htmx #} {% django_htmx_script %} Jinja Templates ^^^^^^^^^^^^^^^ First, load the tag function into the globals of your `custom environment `__: .. code-block:: python # myproject/jinja2.py from jinja2 import Environment from django_htmx.jinja import django_htmx_script def environment(**options): env = Environment(**options) env.globals.update( { # ... "django_htmx_script": django_htmx_script, } ) return env Second, call the function in your base template, after your htmx ``