Metadata-Version: 2.4
Name: heggra
Version: 0.1.0
Summary: An htmx-powered file upload widget for Django forms
Keywords: django,htmx,upload,widget,forms
Author: Brian Pepple
Author-email: Brian Pepple <bpepple@metron.cloud>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Dist: django>=6.0.0
Requires-Dist: pillow>=13.0.0 ; extra == 'image'
Requires-Python: >=3.14
Project-URL: Homepage, https://github.com/Metron-Project/heggra
Project-URL: Documentation, https://heggra.readthedocs.io/
Project-URL: Bug Tracker, https://github.com/Metron-Project/heggra/issues
Project-URL: Changelog, https://github.com/Metron-Project/heggra/blob/main/CHANGELOG.md
Provides-Extra: image
Description-Content-Type: text/markdown

# heggra

An htmx-powered file upload widget for Django forms, with drag and drop, that fits any CSS
framework.

## Setup

heggra needs Python 3.14+, Django 6.0+ and htmx 2. Install it with:

```
pip install heggra
```

Use `pip install "heggra[image]"` for image fields. Add `heggra` to `INSTALLED_APPS`, include
`heggra.urls`, and load htmx and `{{ form.media }}` on the page. Then use the widget:

```python
from heggra import UploadWidget


class IssueForm(forms.ModelForm):
    class Meta:
        model = Issue
        fields = ["cover"]
        widgets = {"cover": UploadWidget(image=True)}
```

The [documentation](https://heggra.readthedocs.io/) covers the rest, including styling for Bulma
and other CSS frameworks.

## Development

```
uv sync
uv run pre-commit install
uv run pytest
uv run ruff check .
```

To build the documentation:

```
uv run --group docs sphinx-build -W docs docs/_build/html
```

## License

heggra is released under the GNU General Public License v3.0 or later. See [LICENSE](LICENSE).
