Facilitates the usage of HTMX with Django
Project description
hx-requests
Full documentation: https://hx-requests.readthedocs.io/en/latest/#
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 code
See full documentation here: https://hx-requests.readthedocs.io/en/latest/#
Installation
pip install hx-requests
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: <script src="https://unpkg.com/htmx.org@1.8.6"></script>
Hyperscript: <script src="https://unpkg.com/hyperscript.org@0.9.8"></script>
Contributing to this repository
Warning CI is not setup yet, but will be at a later date.
Getting setup
# If your system has python3.10 installed make sure the virtual environment is using 3.8
poetry env use python3.8
# Install packages
poetry install
# Install pre-commit hooks
pre-commit install -t pre-commit -t pre-push -t commit-msg
# Activate the virtual environment
poetry shell
Committing
Must follow Conventional Commit https://www.conventionalcommits.org/en/v1.0.0/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hx_requests-0.20.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d7bfe928bcd6d7774f92e392610f07269247644ebc914d147c9b9735217664d |
|
MD5 | fc1fc8e4cd15f49037cef2dc0bb2caa4 |
|
BLAKE2b-256 | 22b91c49982471701b939f43fdb945acbba753b1d3a06d6b0360badbff486c48 |