FormsΒΆ

next.dj wraps Django forms with a registry, a stable POST endpoint, and a re-render pipeline that survives validation failures. This section walks every layer of the system from the page module down to the dispatch backend. Read Forms Overview first, then jump to the page that matches the part you are extending.

Concepts

Forms Overview

The mental model behind actions, dispatch, and re-render.

Building forms

Actions

Register a handler with @action and decide which parameters to ask for.

Form Templates

Render a form with {% form %} and link several forms on a single page.

ModelForms

Use Django ModelForm for create and edit pages.

Formsets

Render and validate Django formsets through the same dispatch pipeline.

Mechanics

Validation and Re-render

What happens between a failing POST and the re-rendered origin page.

Frozen Form Specs

The frozen field, formset, and form specs for rendering a form in a custom template engine.

Extending

Action Backends

Swap the validation pipeline through DEFAULT_FORM_ACTION_BACKENDS.

Form Signals

Every signal the forms subsystem emits, with payload details.