Skip to main content

Better Django forms — modern styling out of the box, then HTMX integration for dynamic behavior

Project description

django-formwork

CI PyPI Python Django License

django-formwork applies DaisyUI styling to Django forms and ships a small set of widgets that lean on htmx and Alpine.js. Set FORM_RENDERER once, include the CSS and JS template tags, and {{ form }} produces DaisyUI markup. The admin is unaffected; it renders widgets directly, never {{ form }} or as_field_group().

Quick start

pip install django-formwork
# settings.py
INSTALLED_APPS = [..., "django_formwork"]
FORM_RENDERER = "django_formwork.FormworkRenderer"
{% load formwork %}
{% formwork_css %}
{{ form }}
{% formwork_js %}

Widgets

Toggle, Range, Rating, PasswordReveal, SearchSelect, MultiSelect, ComboBox, DataList, FileDropZone, ImageDropZone, ValidatedTextarea, DatePicker, InputNumber, InputMask, OTPInput, PhoneInput, CountryInput. The three dropdown widgets auto-register a server-side search endpoint when used on a FormworkForm. ValidatedTextarea does the same for live server-side text validation.

htmx 4 integration

{% formwork_js %} loads formwork.js as an ES module. It imports formwork-core.js (the formwork-morph htmx extension, dirty-field tracking, native validation disabling) and each widget's Alpine component. Per-form {{ form.media }} and bundler imports are also supported; details are in the installation docs.

Requirements

Python 3.14+, Django 6.0, DaisyUI 5, Tailwind CSS 4. DaisyUI and Tailwind are not bundled.

Documentation

https://oliverhaas.github.io/django-formwork/

Contributing

Screenshot baselines under tests/widgets/screenshots/ use Git LFS. Install it once globally before cloning:

sudo apt install git-lfs   # or brew install git-lfs
git lfs install

If you cloned before installing LFS, run git lfs install && git lfs pull to fetch the PNG bytes.

License

BSD 3-Clause. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_formwork-0.1.0a2.tar.gz (64.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_formwork-0.1.0a2-py3-none-any.whl (99.3 kB view details)

Uploaded Python 3

File details

Details for the file django_formwork-0.1.0a2.tar.gz.

File metadata

  • Download URL: django_formwork-0.1.0a2.tar.gz
  • Upload date:
  • Size: 64.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for django_formwork-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 bc6544bcd3fdcf6006c2497f700662e7b371dd6526adaaa55d5b0ef40f65b643
MD5 ea2e55cf95e382f7eeabf8a9ad96fb2b
BLAKE2b-256 d26017ee6ad55960aa42073a7b60a0b0ece00d010526d4b8af9d9dd31191cdc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_formwork-0.1.0a2.tar.gz:

Publisher: publish.yml on oliverhaas/django-formwork

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_formwork-0.1.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_formwork-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 44e345b2c62e884b158f8bef8af77b57aa0450b0eaa06d13803dbd551b57d607
MD5 3b89da13180db59cccd6d510b0e31609
BLAKE2b-256 5cf46aa67169a51d649182af102c2cbae862d63c17910833237573e0f41ea194

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_formwork-0.1.0a2-py3-none-any.whl:

Publisher: publish.yml on oliverhaas/django-formwork

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page