Internals Overview¶
next.dj is built from the subsystems mapped below, which share one settings layer, one dependency resolver, and one signal bus. This page maps them and shows how signals flow between them.
Note
If you want to know how to extend the framework rather than how it works inside, read Extending first. That page covers the five extension mechanisms and the decision tree for choosing between them. The pages here explain the implementation.
Subsystems¶
Subsystem |
Responsibility |
Public module |
|---|---|---|
Pages |
Page modules, layouts, body sources, context, processors. |
|
Components |
Component discovery, loading, rendering, slots, context. |
|
URLs |
File router, dispatcher, reverse helpers, hot reload. |
|
Forms |
Form action registry, dispatch, validation, formsets. |
|
Static |
Asset discovery, collector, kinds, backends, JS context. |
|
Dependencies |
Parameter resolver, providers, request cache. |
|
Server |
Autoreload watcher, watch specs, signals. |
|
Config |
Settings access, defaults, helpers. |
|
Testing |
Test client, signal recorder, isolation. |
|
App |
Django |
|
Bootstrap¶
Django calls NextFrameworkConfig.ready() once per process after all applications load.
The hook registers the framework system checks and runs four installers that wire the subsystems above into the Django runtime before the first request arrives.
See Apps Reference for the canonical ordering and the full API.
How They Compose¶
A request hands off next.urls to next.pages to next.deps to next.static and next.components before the final HTML returns to the client.
Form submissions take a parallel path through next.forms, which on validation failure reuses the same render pipeline.
Request Lifecycle traces both paths end to end.
Signals Fan Out¶
Most cross subsystem coordination happens through signals. The diagram below shows which subsystem emits each signal and the typical receivers.
flowchart LR
Pages["next.pages"]
Components["next.components"]
URLs["next.urls"]
Forms["next.forms"]
Static["next.static"]
Deps["next.deps"]
Server["next.server"]
Conf["next.conf"]
Audit["Audit and metrics"]
Cache["Cache invalidation"]
Watch["Long lived listeners"]
Pages -- "template_loaded, context_registered, page_rendered" --> Audit
Components -- "component_registered, components_registered, component_rendered, component_backend_loaded" --> Audit
URLs -- "route_registered, router_reloaded" --> Watch
Forms -- "action_registered, action_dispatched, form_validation_failed" --> Audit
Forms -- "action_dispatched" --> Cache
Static -- "asset_registered, collector_finalized, html_injected, backend_loaded" --> Audit
Deps -- "provider_registered" --> Audit
Server -- "watch_specs_ready" --> Watch
Conf -- "settings_reloaded" --> Watch
Conf -- "settings_reloaded" --> Cache
Note
The diagram is a coordination sketch. Signals is the canonical catalog of signal names, senders, and payloads.
Subsystem Dependencies¶
The dependency graph between subsystems is shallow.
next.confhas no internal dependencies and sits at the bottom.next.depsdepends only onnext.conf.next.pages,next.components,next.staticdepend onnext.confandnext.deps.next.formsdepends onnext.pagesandnext.deps.next.urlsdepends onnext.conf,next.deps,next.pages,next.components, andnext.forms.next.serverdepends onnext.conf,next.pages,next.urls, andnext.components, the subsystems whose trees it watches.next.testingdepends on the page, component, form, dependency, and static subsystems to drive isolation and rendering helpers.next.appsdepends on every subsystem. It is the Django-facing entry point that calls each subsystem’s startup hook.
Module Map¶
Each subsystem keeps a flat module layout.
Subsystem |
Submodules |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See Also¶
See also
Request Lifecycle for the end to end request path. Extending for the user-facing extension mechanisms built on top of this architecture. Signals for the signal catalog. API Reference for the public API.