Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yaakovLowenstein/hx-requests
A package to facilitate the use of HTMX with Django
https://github.com/yaakovLowenstein/hx-requests
django htmx
Last synced: about 2 months ago
JSON representation
A package to facilitate the use of HTMX with Django
- Host: GitHub
- URL: https://github.com/yaakovLowenstein/hx-requests
- Owner: yaakovLowenstein
- License: mit
- Created: 2023-03-28T00:43:30.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T19:49:06.000Z (4 months ago)
- Last Synced: 2024-10-10T22:39:20.748Z (3 months ago)
- Topics: django, htmx
- Language: Python
- Homepage:
- Size: 301 KB
- Stars: 55
- Watchers: 2
- Forks: 6
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-python-htmx - hx-requests - Django-a9bbcc?style=flat&logo=django&logoColor=black" alt="Django"></a> <br/> (Third Party Packages 📦 <a name = "tools"></a> / Helper Libraries)
README
# hx-requests
Full documentation: https://hx-requests.readthedocs.io/en/latest/#
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-blue.svg)](https://docs.astral.sh/ruff/formatter/)
[![Code style: djlint](https://img.shields.io/badge/html%20style-djlint-blue.svg)](https://www.djlint.com)Hx-requests is a package to simplify the usage of htmx with Django.
It enables an application to make asyncronous requests without clogging up
views and urls with extra code. It simplifies making django forms post asyncronously
with htmx, and many other awesome features.The idea of hx-requests is that `HXRequests` absorb all htmx requests.
Define an `HXRequest` and
observe the magic of `hx-requests`.- No need to define extra urls to handle these requests
- No need to add anything extra in views
- Reusable `HXRequests` across views
- Built in `HXRequests` to reduce boilerplate codeSee full documentation here: https://hx-requests.readthedocs.io/en/latest/#
# Installation
```python
pip install hx-requests
``````python
INSTALLED_APPS = (
...
'hx_requests',
)
```**Note**
It's assumed that htmx is already included in the base html file. It's also recommended to include hyperscript.
Htmx: ``Hyperscript: ``
# Contributing to this repository
## Getting setup
- This project is using poetry
- pre-commit is used for CI (code formatting, linting, etc...)
- There is a dev container that can be used with vs-code## Committing
Must follow Conventional Commit
https://www.conventionalcommits.org/en/v1.0.0/