Documentation: https://django-htmx-messages.readthedocs.io
Source Code: https://github.com/abe-101/django-htmx-messages
Django+HTMX integration with the messages framework
A PyPI package for Benoit Blanchon's django-htmx-messages-framework (used with permission). It integrates Django's messages framework with HTMX for dynamic toast notifications.
Install this via pip (or your favourite package manager):
pip install django-htmx-messages
Add the app to your INSTALLED_APPS
:
```python
INSTALLED_APPS = [
"django_htmx_messages",
]
MIDDLEWARE = [
"django_htmx_messages.middleware.HtmxMessageMiddleware",
]
Add to your base template:
<head>
<script src="{% static 'htmx.min.js' %}" defer></script>
<script src="{% static 'toasts.js' %}" defer></script>
</head>
<body>
{# Your content here #} {% include 'toasts.html' %}
</body>
git clone https://github.com/abe-101/django-htmx-messages.git
cd django-htmx-messages
uv sync
uv run manage.py runserver
Thanks goes to these wonderful people (emoji key):
Abe Hanoka 💻 🤔 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
- Original implementation by Benoit Blanchon This package was created with Copier and the browniebroke/pypackage-template project template.