djangodocs.org

706 sections in Django 6.0 Search all versions →

Jinja2

Reference The form rendering API Built-in-template form renderers

Templates for the built-in widgets are located in django/forms/jinja2 and installed apps can provide templates in a jinja2 directory. To use this backend, all the forms and widgets in your project and its third-party apps must have Jinja2 templates.

Reference The form rendering API

This is a dictionary that contains values like: name value attrs is_hidden template_name Some widgets add further information to the context. For instance, all widgets that subclass Input defines widget['type'] and MultiWidget defines widget['subwidgets'] for looping purposes.

Reference The form rendering API

Built-in widget templates are stored in the django/forms/widgets path. You can provide a custom template for input.html by defining django/forms/widgets/input.html, for example. See Built-in widgets for the name of each widget’s template.

Range Fields

Reference PostgreSQL specific form fields and widgets Fields

This group of fields all share similar functionality for accepting range data. They are based on MultiValueField. They treat one omitted value as an unbounded range. They also validate that the lower bound is not greater than the upper bound.