Skip to content

abe-101/django-htmx-messages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Htmx Messages

CI Status Documentation Status Test coverage percentage

uv Ruff pre-commit

PyPI Version Supported Python versions License


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.

Demo

Installation

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>

Try the Demo

git clone https://github.com/abe-101/django-htmx-messages.git
cd django-htmx-messages
uv sync
uv run manage.py runserver

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Abe Hanoka
Abe Hanoka

💻 🤔 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

About

Django+HTMX integration with the messages framework

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published