django-widget-tweaks
Tweak the form field rendering in templates, not in python-level form definitions.
Decision gist · record as of 2026-08-14
Yes. It is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and solves a real workflow problem—separating form presentation from Python logic. Install if your Django project has designers or front-end developers who need to customize form rendering without Python changes.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only django as a runtime dependency.
- Active maintenance—last commit 2026-06-29, 2163 repository stars, and a release within the last year.
License · maintenance · safety
MIT license (permissive) — MIT license (permissive). No restrictions on commercial or private use; you may modify and redistribute with attribution.
last release 2026-01-02 (224 days) · last repo commit 2026-06-29 · 2,163 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,559,231 downloads/mo, #3,763 on PyPI
Alternatives
Verify before relying
# Install
pip install django-widget-tweaks
# Add to INSTALLED_APPS in settings.py
INSTALLED_APPS += ['widget_tweaks']
# In template
{% load widget_tweaks %}
{{ form.title|add_class:"css_class_1 css_class_2" }}
{% render_field form.search_query type="search" %}What it is and what it does
django-widget-tweaks is a template library that lets designers and front-end developers customize how Django form fields render in HTML without writing Python code. It provides template tags and filters to add or modify CSS classes, HTML attributes, and data attributes on form fields directly in templates.
The package offers two main interfaces: a `render_field` tag with HTML-like syntax for straightforward customization, and a set of filters (`add_class`, `attr`, `set_data`, `add_error_class`, etc.) for more granular control. It handles single and multi-widget fields, supports filter chaining with leftmost-wins semantics for reusable templates, and integrates cleanly with Django's form rendering pipeline.
Use it for
- Add CSS classes to form fields for styling without touching Python form code.
- Set HTML5 data attributes on fields for unobtrusive JavaScript hooks.
- Apply error or required-field styling conditionally based on validation state.
- Convert input types to HTML5 variants (e.g., text to search) in templates.
- Build reusable field templates with overridable default attributes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
It is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and solves a real workflow problem—separating form presentation from Python logic. Install if your Django project has designers or front-end developers who need to customize form rendering without Python changes.
Install
django-widget-tweaks on PyPI
Before you install
Low friction: pure Python wheel with only django as a runtime dependency. Active maintenance—last commit 2026-06-29, 2163 repository stars, and a release within the last year.
License in practice
MIT license (permissive). No restrictions on commercial or private use; you may modify and redistribute with attribution.
Quickstart
# Install
pip install django-widget-tweaks
# Add to INSTALLED_APPS in settings.py
INSTALLED_APPS += ['widget_tweaks']
# In template
{% load widget_tweaks %}
{{ form.title|add_class:"css_class_1 css_class_2" }}
{% render_field form.search_query type="search" %}
Package facts
| License | MIT license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedjango |
| Maintenance | Actively maintained 224 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,559,231 / month, #3,763 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules |
Evidence: django_widget_tweaks-1.5.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django form field styling”
- django-widget-tweaksCustomize Django form field HTML and CSS in templates using template…
- crispy-tailwindProvides Tailwind CSS styling templates for django-crispy-forms,…
- django-crispy-formsRenders Django forms programmatically with full HTML control using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also django-tinymce · crispy-tailwind · crispy-bootstrap4 · django-json-widget · django-bootstrap-form · django-js-asset · django-ace · django-debug-toolbar-template-profiler · django-debug-toolbar-template-timings · django-dirtyfields