lfp-importmap
A simple way to use Javascript importmaps in your Django projects.
What can you do with it?
Use Javascript libraries in your Django projects without having to install node and related frontend tooling like webpack, etc.
No frontend build system required!
How to use it?
- Install from pypi
uv add lfp-importmap
or
pythom -m pip install lfp-importmap
- Add
lfp_importmapto yourINSTALLED_APPSin yoursettings.py
INSTALLED_APPS = [
...
'lfp_importmap',
]
- Add any JS library using the new management command:
python manage.py importmap add htmx.org
This will create an importmap.config.json file in your project root.
It will also vendor the package code and make it available in your templates.
- In your
base.htmltemplate, add the following:
{% load lfp_importmap %}
<html>
<head>
... {% javascript_importmap_tags %}
</head>
<body>
...
</body>
</html>
- That's it! The module is now ready for use in your templates.
Continuing the example from above, you can now use the htmx module in your templates:
<button hx-get="{% url 'my-url-name' %}">Click me</button>
LICENSE
MIT
Metadata
Release files for lfp-importmap 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lfp_importmap-0.2.0.tar.gz | 22.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lfp_importmap-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.5 kB
Release files / lfp_importmap-0.2.0.tar.gz
| Download URL | lfp_importmap-0.2.0.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
238e0e42baf4b77730dba89a24f2c802faf58ceb14c4f5119364bdba94efcf5c
|
|
BLAKE2b-256 checksum How to use checksums |
03b45abc438ec30690040fcb1b001b67090953335b8ba29c1d630be85963c64e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.13
|
Release files / lfp_importmap-0.2.0-py3-none-any.whl
| Download URL | lfp_importmap-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42afc2dfa2e000d96e0111e1a39858bd1e1820114b06b4d749f2f334def2f886
|
|
BLAKE2b-256 checksum How to use checksums |
b059f573c614dadc3d2fbf85d22d7cdd777603a42ba7458df89bd18bbd75eebf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.13
|
Security for lfp-importmap 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.