APIActive

Django Forms API

Django's forms API for binding data, validating input, and rendering forms as HTML.

Open source page ↗

Product features

Product features

Bound and unbound forms

Form instances are either bound to data or unbound; is_bound distinguishes them at runtime.

BoundField

Access form fields and their attributes and methods for granular output control.

Cast ¶

clean()

Implement clean() on a Form to add custom validation for interdependent fields.

Coalesce ¶

Collate ¶

Comparison and conversion functions ¶

Database Functions ¶

Date functions ¶

DateField extracts ¶

DateTimeField extracts ¶

errors

Dictionary of field names to lists of error messages; also supports as_data() and as_json().

Extract ¶

Greatest ¶

is_valid()

Runs validation on a bound form and returns a boolean indicating whether the data is valid.

Least ¶

NullIf ¶

Output styles

Render forms via as_div(), as_p(), as_ul(), and as_table().