Signals Reference¶
Module Summary¶
next.signals is an aggregator that re-exports every signal emitted by the framework.
Importing a signal from next.signals is equivalent to importing it from its subpackage.
Signal Catalog¶
Every signal below is a Django Signal. The sender column lists the value
passed to Signal.send. Receivers connected with a matching sender only
fire for that sender.
Signal |
Sender |
Keyword arguments |
When it fires |
|---|---|---|---|
|
|
|
After an action handler runs and the response is coerced.
|
|
Form action backend class |
|
After the backend stores a handler for an action name. |
|
The |
|
After a file is registered with a backend and added to the collector. |
|
The static backend class |
|
After the static factory instantiates a backend. |
|
The static collector |
|
When the static manager begins injection, after template rendering completes. |
|
|
|
After a component backend is created from its configuration entry. |
|
|
|
After a single component is registered. Not fired from the bulk path. |
|
|
|
After a component is rendered to HTML. |
|
|
|
After a batch of components is registered. |
|
|
|
After a context callable is attached to a page module. |
|
|
|
When the bound form fails validation during dispatch. |
|
A |
|
After placeholder replacement completes. |
|
|
|
After |
|
The |
none |
When a |
|
|
|
After a URL pattern is created for a discovered page. |
|
The router manager class |
none |
After the router manager rebuilds its pattern set. |
|
|
none |
After |
|
|
|
After a template source is registered on a page. |
|
|
|
After the reloader resolves the full list of watch specs. |
Subpackage Signals¶
The aggregator next.signals forwards from the modules below.
Pages¶
Signals emitted during template loading, context collection, and rendering.
These signals let external subscribers observe the page rendering pipeline without subclassing internal collaborators.
The template_loaded signal fires after a template source is registered on a page. The sender is Page. The keyword argument is file_path.
The context_registered signal fires after a context callable is attached to a page module. The sender is PageContextRegistry. The keyword arguments are file_path and key.
The page_rendered signal fires after Page.render finishes producing HTML and injecting static assets. The sender is Page. The keyword arguments are file_path, duration_ms, styles_count, scripts_count, and context_keys.
Components¶
Django signals emitted by the components subsystem.
URLs¶
Django signals emitted by the URL routing subsystem.
Forms¶
Django signals emitted by the forms subsystem.
The action_registered signal fires after the backend stores a handler for a name. The sender is the backend class. The keyword arguments are action_name, uid, form_class, namespace, and handler.
The action_dispatched signal fires after a handler runs and the response has been coerced. The sender is FormActionDispatch. The keyword arguments are action_name, form, url_kwargs, duration_ms, response_status, and dep_cache. form is the bound form instance after successful validation, or None for handler-only actions registered without a form_class. url_kwargs is a copy of the URL kwargs the dispatcher resolved before invoking the handler. dep_cache is a snapshot of the dispatch DI cache so receivers can read named dependencies (Depends(“name”) values) resolved during this dispatch without re-running their providers.
The form_validation_failed signal fires when the bound form fails validation during dispatch. The sender is FormActionDispatch. The keyword arguments are action_name, error_count, and field_names.
Static¶
Django signals emitted across the static pipeline.
Signals are the primary extension mechanism for hooking into asset lifecycle events without subclassing the collector, the backend, or the manager. Subscribe from AppConfig.ready and keep handlers synchronous. All four signals are dispatched in hot rendering paths.
The asset_registered signal fires after a file is registered with a backend and added to the collector. The sender is the asset instance and the keyword arguments are collector and backend.
The collector_finalized signal fires when the static manager begins injection, after template rendering has completed and the collector is sealed. The sender is the collector. The keyword arguments are page_path, which may be None for partial renders, and request, which is the active HttpRequest or None for renders outside a request lifecycle.
The html_injected signal fires after placeholder replacement completes. The sender is the static manager. The keyword arguments are html_before, html_after, collector, placeholders_replaced, injected_bytes, and request. The request argument carries the active HttpRequest or None.
The backend_loaded signal fires after the static factory instantiates a backend. The sender is the backend class. The keyword arguments are config and instance.
Dependencies¶
Django signals emitted by the dependency-injection layer.
provider_registered fires whenever a RegisteredParameterProvider subclass is added to the auto-registry. External code may listen to the signal to observe provider wiring, typically in tests or diagnostics.
- next.deps.signals.provider_registered: Signal = <django.dispatch.dispatcher.Signal object>¶
Emitted when a RegisteredParameterProvider subclass registers itself.
Server¶
Signals emitted by the development server watch layer.
watch_specs_ready fires after the reloader resolves the full list of watch specs. Subscribers can inspect or augment the effective spec set without subclassing the reloader.
Configuration¶
Django signals emitted by the configuration layer.
settings_reloaded fires after NextFrameworkSettings.reload drops its caches. Package-level managers subscribe to this signal and reset their own state when the merged settings change. The module also wires the Django setting_changed signal so that tests using override_settings trigger the reload path automatically.
- next.conf.signals.settings_reloaded: Signal = <django.dispatch.dispatcher.Signal object>¶
Emitted when NextFrameworkSettings caches have been dropped.
See Also¶
See also
Signals for receiver patterns and testing helpers.