System checks#
Module summary#
next.dj contributes Django system checks for every subsystem.
Run them through uv run python manage.py check and the framework reports configuration mistakes with a code and a hint.
Check registration#
next.checks.register_all runs during AppConfig.ready.
It imports each subsystem checks module so the @register side effects take effect.
The imported modules are next.conf.checks, next.pages.checks, next.urls.checks, next.components.checks, and next.forms.checks.
The list continues with next.static.checks, next.partial.checks, and next.apps.checks.
Each of these modules registers checks. The dependency injection layer contributes no Django system checks.
Every next.dj check carries the next tag.
Run uv run python manage.py check --tag next to execute only the framework checks and skip the built-in Django and third-party ones.
Checks that also concern templates or URL patterns keep their Django tags (templates, urls) alongside next, so filtering by those tags still reaches them.
A tagged run reports what a full run reports: every check that reads registrations discovers the files declaring them itself, rather than relying on a URL check having expanded the router first.
next.checks.reset_check_caches drops every per-run check cache so the next run rebuilds from the current sources.
The cached state covers the router and components managers, the composed-pages memo, the collected URL patterns, the page module memo, and the context registry.
Most of these caches also clear on settings_reloaded, which a NEXT_FRAMEWORK change through override_settings triggers.
Tests and scripts that invoke checks directly and mutate the page or component tree in place call reset_check_caches explicitly, since the caches otherwise freeze the scanned state for the lifetime of the process.
Subsystem checks#
Pages#
System checks for the pages subsystem.
- next.pages.checks.check_context_functions(*args, **kwargs) list[CheckMessage][source]#
Require keyless @context callables to return a dict when invoked.
- next.pages.checks.check_context_processor_signature(*args, **kwargs) list[CheckMessage][source]#
Warn when a configured context processor has no request parameter.
- next.pages.checks.check_context_registration_files(*args, **kwargs) list[CheckMessage][source]#
Flag a @context no page render collects (next.E074).
A registration keys on the file declaring the callable, so decorating an imported helper binds it to that helper’s module, and decorating a callable from a sibling page.py binds it to that other page.
- next.pages.checks.check_layout_templates(*args, **kwargs) list[CheckMessage][source]#
Check layout.djx files for the {% block template %} structure.
- next.pages.checks.check_page_functions(*args, **kwargs) list[CheckMessage][source]#
Validate each page module for render or template. Warn when empty.
- next.pages.checks.check_page_module_imports(*args, **kwargs) list[CheckMessage][source]#
Report page.py files that raise while importing (next.E017).
The message carries the recorded cause, so an ImportError raised by the module body is named as such instead of masking as a missing body.
- next.pages.checks.check_pages_structure(*args, **kwargs) list[CheckMessage][source]#
Check each router’s pages tree for layouts, naming, and structure.
- next.pages.checks.check_request_in_context(*args, **kwargs) list[CheckMessage][source]#
Ensure request is in the template context (required for {% form %}).
- next.pages.checks.check_single_keyless_context(*args, **kwargs) list[CheckMessage][source]#
Flag a page.py with more than one keyless @context (next.E018).
Keyless callables share one slot, so only the last survives and runs.
- next.pages.checks.check_template_loaders(*args, **kwargs) list[CheckMessage][source]#
Validate every NEXT_FRAMEWORK[‘TEMPLATE_LOADERS’] entry.
- next.pages.checks.check_unrouted_working_directory_pages(*args, **kwargs) list[CheckMessage][source]#
Warn when a pages tree beside the process is routed by nobody (next.W002).
A project that lists no root in DIRS keeps writing pages under a directory the router never reaches, and the pages are never served. Nothing else reports that, because the checks walk the trees the routers report and this one is not among them.
URLs#
System checks for the URL routing subsystem.
- next.urls.checks.check_next_pages_configuration(*args, **kwargs) list[CheckMessage][source]#
Validate PAGE_BACKENDS inside merged NEXT_FRAMEWORK.
- next.urls.checks.check_reverse_name_collisions(*args, **kwargs) list[CheckMessage][source]#
Fail when two distinct routes collapse to the same reverse URL name.
Components#
System checks for the components subsystem.
- next.components.checks.check_component_context_registration_files(*args, **kwargs) list[CheckMessage][source]#
Flag a @component.context no component render collects (next.E075).
A registration keys on the file declaring the callable, so decorating an imported helper binds it to that module, and decorating a callable from a sibling component.py binds it to that other component.
- next.components.checks.check_component_py_no_pages_context(*args, **kwargs) list[CheckMessage][source]#
Check that component.py files do not use context from next.pages.
- next.components.checks.check_cross_root_component_name_conflicts(*args, **kwargs) list[CheckMessage][source]#
Reject a root-scope name that only registration order resolves.
- next.components.checks.check_duplicate_component_names(*args, **kwargs) list[CheckMessage][source]#
Check that no two components share a name within one route scope.
The scope is the pair the resolver scores on, so the same name under two route trails of one tree is the documented override rather than a clash.
Forms#
System checks for the forms subsystem.
- next.forms.checks.check_action_applied_to_class(*args, **kwargs) list[CheckMessage][source]#
Error when @action decorator was applied to a class.
- next.forms.checks.check_action_guard_permissions(*args, **kwargs) list[CheckMessage][source]#
Warn when permission_required is declared without django.contrib.auth.
This inspects the static ActionGuard only. The dynamic check_permissions and has_object_permission hooks run application code per request and are not statically inspectable, so no check covers them.
- next.forms.checks.check_component_widget_components(*args, **kwargs) list[CheckMessage][source]#
Warn when a ComponentWidget names a component that does not resolve.
- next.forms.checks.check_component_widget_field_types(*args, **kwargs) list[CheckMessage][source]#
Warn when a ComponentWidget is attached to an unsupported field type.
- next.forms.checks.check_form_action_backends_configuration(*args, **kwargs) list[CheckMessage][source]#
Validate FORM_ACTION_BACKENDS shape and import paths.
- next.forms.checks.check_form_action_collisions(*args, **kwargs) list[CheckMessage][source]#
Flag two @action calls that share a name but come from different handlers.
- next.forms.checks.check_form_anchor_files(*args, **kwargs) list[CheckMessage][source]#
Validate that FORM_ANCHOR_FILES is None or a collection of strings.
- next.forms.checks.check_form_wizard_backend(*args, **kwargs) list[CheckMessage][source]#
Validate FORM_WIZARD_BACKEND shape and import path.
- next.forms.checks.check_form_wizard_sessions(*args, **kwargs) list[CheckMessage][source]#
Warn when wizard storage needs sessions without django.contrib.sessions.
- next.forms.checks.check_form_wizard_steps(*args, **kwargs) list[CheckMessage][source]#
Error when a FormWizard declares no steps.
- next.forms.checks.check_forms_outside_base_dir(*args, **kwargs) list[CheckMessage][source]#
Warn when form classes are declared outside BASE_DIR.
- next.forms.checks.check_instance_from_url_on_non_model_form(*args, **kwargs) list[CheckMessage][source]#
Error when Meta.instance_from_url is set on a class that is not a ModelForm.
- next.forms.checks.check_instance_from_url_unknown_field(*args, **kwargs) list[CheckMessage][source]#
Error when Meta.instance_from_url references a field absent on the model.
- next.forms.checks.check_invalid_form_meta_scope(*args, **kwargs) list[CheckMessage][source]#
Error when a form class Meta.scope or an @action scope is invalid.
Error when one shared action name is declared by two different modules.
- next.forms.checks.check_success_message_framework(*args, **kwargs) list[CheckMessage][source]#
Warn when Meta.success_message is declared without the messages framework.
- next.forms.checks.check_wizard_step_actions(*args, **kwargs) list[CheckMessage][source]#
Warn when a wizard step class is also a registered standalone action.
Only static Meta.steps are inspected, get_steps dynamics are not visible.
- next.forms.checks.check_wizard_step_field_collisions(*args, **kwargs) list[CheckMessage][source]#
Warn when two static wizard steps declare the same field name.
Only static Meta.steps are inspected, get_steps dynamics are not visible.
- next.forms.checks.check_wizard_step_file_fields(*args, **kwargs) list[CheckMessage][source]#
Warn when a static wizard step declares a FileField or ImageField.
Only static Meta.steps are inspected, get_steps dynamics are not visible.
- next.forms.checks.check_wizard_url_param_route(*args, **kwargs) list[CheckMessage][source]#
Error when a page-scoped wizard’s page path lacks the url_param segment.
Only wizards declared in a page module are inspected. The page file path maps one to one onto the route, so a missing segment is a definite misconfiguration. Wizards declared in shared or component modules have no statically known route and are skipped.
Static#
System checks for the static subsystem.
All identifiers live in the next.* namespace to avoid collisions with Django core checks.
- next.static.checks.check_static_backends(**kwargs) list[CheckMessage][source]#
Validate the structure of NEXT_FRAMEWORK[‘STATIC_BACKENDS’].
- next.static.checks.check_asset_kinds_are_loadable(*args, **kwargs) list[CheckMessage][source]#
Warn about a registered kind the partial runtime cannot insert.
- next.static.checks.check_inline_asset_bodies_are_loadable(*args, **kwargs) list[CheckMessage][source]#
Warn about a kind whose inline bodies the partial runtime cannot insert.
Partial rendering#
System checks for the partial-rendering subsystem.
This module is excluded from coverage like every other area checks.py. The zone checks read the same compiled page templates the renderer uses, so a misconfigured zone is caught at manage.py check time rather than on a partial request.
- next.partial.checks.check_composed_templates_compile(*args, **kwargs) list[CheckMessage][source]#
Error when a composed page template fails to compile (next.E072).
The zone checks skip a page whose composed template does not compile, so without this check the syntax error would surface only as a 500 on the first request to the page.
- next.partial.checks.check_custom_patch_ops_well_formed(*args, **kwargs) list[CheckMessage][source]#
Error when a custom patch verb is malformed or shadows a built-in (next.E066).
The runtime guard in Patches.op() rejects an unregistered verb on every call. This check turns the registry side of that contract into a startup error: a verb registered with a non-token name or one that silently shadows a built-in verb is caught at manage.py check rather than only when an op of that name reaches a client.
- next.partial.checks.check_duplicate_zone_names(*args, **kwargs) list[CheckMessage][source]#
Error when two zones in one composed page share a name (next.E060).
- next.partial.checks.check_form_backend_partial_aware(*args, **kwargs) list[CheckMessage][source]#
Warn when partial rendering is on but a form backend is not aware (next.W068).
The base FormActionBackend.shape_response routes partial requests to the patch shaping path. A custom backend that overrides shape_response without that branch would silently drop the patch envelope and serve a full page to the runtime. The check stays silent on the default backend, which inherits the partial-aware method.
- next.partial.checks.check_lazy_zone_has_placeholder(*args, **kwargs) list[CheckMessage][source]#
Error when a lazy zone declares no {% placeholder %} (next.E064).
- next.partial.checks.check_manifest_version_has_manifest_storage(*args, **kwargs) list[CheckMessage][source]#
Warn when manifest versioning has no manifest storage (next.W069).
The VERSION: “manifest” option asks the version stamp to track the staticfiles manifest, so a deploy of new assets bumps the version and the client reloads. That guard is silent unless the active staticfiles storage hashes its files into a manifest. The check pairs with the runtime fallback that resolves the sentinel to a stable default when no manifest storage is configured, surfacing the dead guard at startup.
- next.partial.checks.check_no_zone_in_component(*args, **kwargs) list[CheckMessage][source]#
Error when a component template declares a zone (next.E065).
- next.partial.checks.check_partial_backend_names_a_path(*args, **kwargs) list[CheckMessage][source]#
Error when a PARTIAL_BACKENDS entry omits its BACKEND key (next.E073).
Such an entry falls back to the default protocol backend, so the intended wire format would silently never load. The check names the entry that lacks a dotted path at startup instead.
- next.partial.checks.check_repeated_form_has_key(*args, **kwargs) list[CheckMessage][source]#
Warn when a looped {% form %} has no key or zone (next.W070).
- next.partial.checks.check_single_partial_backend(*args, **kwargs) list[CheckMessage][source]#
Warn when more than one partial protocol backend is configured (next.W071).
Partial rendering uses a single protocol backend. Only the first valid PARTIAL_BACKENDS entry is instantiated, so a second entry is dead config that silently never runs.
- next.partial.checks.check_with_directly_over_zone(*args, **kwargs) list[CheckMessage][source]#
Warn when a {% with %} wraps a zone directly (next.W067).
- next.partial.checks.check_zone_name_is_slug(*args, **kwargs) list[CheckMessage][source]#
Error when a zone name is not an ASCII slug (next.E061).
- next.partial.checks.check_zone_not_in_if(*args, **kwargs) list[CheckMessage][source]#
Error when a zone sits inside an {% if %} block (next.E063).
- next.partial.checks.check_zone_not_in_loop(*args, **kwargs) list[CheckMessage][source]#
Error when a zone sits inside a {% for %} loop (next.E062).
- next.partial.checks.reset_composed_pages_memo(**kwargs) None[source]#
Drop the memoised composed-page list for the next check run.
Identity against the router manager already invalidates the memo when the manager is rebuilt. Call this explicitly after editing a .djx in place under a live manager, since settings_reloaded only fires when NEXT_FRAMEWORK itself changes.
Apps#
System checks for next-dj template engine wiring.
The next-dj tags install only into a DjangoTemplates backend and only through the explicit builtin tuple. A project missing either one gets a warning here instead of a missing-tag error at render time.
- next.apps.checks.check_builtin_tag_libraries_complete(*args, **kwargs) list[CheckMessage][source]#
Warn when a tag library is not registered as a builtin (next.W063).
The builtin registration list is the explicit _BUILTIN_MODULES tuple. A tag library module added under next.templatetags but left out of that tuple installs into no engine, so its tags silently fail to load. This check pairs the explicit list with a completeness probe over the modules that exist on disk.
Configuration#
System checks for the configuration layer.
Unknown top-level keys are reported as next.E035, values whose type the settings merge would silently discard as next.E076, a NEXT_FRAMEWORK that is no dict at all as next.E077, and non-bool values for bool flags as next.W072.
- next.conf.checks.check_next_framework_unknown_top_level_keys(*args, **kwargs) list[CheckMessage][source]#
Reject keys under NEXT_FRAMEWORK that are not defined in defaults.
- next.conf.checks.check_next_framework_value_types(*args, **kwargs) list[CheckMessage][source]#
Report NEXT_FRAMEWORK values whose type the merge would silently drop.
A NEXT_FRAMEWORK that is no dict is next.E077 on its own and skips the per-key probes, which have nothing to index into. It carries its own id because silencing the noise from one mistyped key must not silence “the whole setting is ignored”.
Dependency injection#
The dependency injection layer does not contribute Django system checks.
There is no next.ENNN code for a missing provider or a bad marker graph.
Note
Expect misconfiguration at runtime.
Unresolved parameters become None, and cycles raise DependencyCycleError.
Troubleshooting lives in Dependency injection and Troubleshooting.
Check code reference#
The codes follow the Django convention next.X<NNN> where X is E for errors and W for warnings.
Errors#
Code |
Condition |
Emitted by |
|---|---|---|
|
|
|
|
A |
|
|
A page backend entry does not specify |
|
|
A page backend entry names an unknown backend. |
|
|
The file router |
|
|
The file router |
|
|
The router manager fails to initialize. |
|
|
A |
|
|
A |
|
|
A parameter directory is missing its |
|
|
An error was raised while checking page functions. |
|
|
A |
|
|
A page |
|
|
An error was raised while checking URL conflicts. |
|
|
The same URL pattern is defined in more than one location. |
|
|
An error was raised while collecting patterns from a router. |
|
|
A |
|
|
A |
|
|
|
|
|
A component name is registered more than once under one route scope, so nothing tells the two apart. |
|
|
A |
|
|
|
|
|
|
|
|
A file router entry is missing |
|
|
A file router entry is missing |
|
|
A file router entry is missing |
|
|
A |
|
|
A route repeats one or more bracket parameter names, all listed in the error. |
|
|
A keyless |
|
|
An error was raised while checking router pages.
A router whose |
|
|
A component backend entry is missing a required key. |
|
|
A component backend |
|
|
|
|
|
A component name sits at the root scope of two roots the same template resolves against, with neither taking precedence. |
|
|
A configuration dict has unknown keys. |
|
|
A static backend dotted path fails to import. |
|
|
A static backend entry is not a dict, or the class is not a |
|
|
|
|
|
Two distinct routes collapse to the same reverse URL name after separator normalisation. |
|
|
A configured context processor does not accept a |
|
|
A form action name is registered by more than one handler. |
|
|
A |
|
|
A |
|
|
A form action backend entry has the wrong shape or cannot be imported. |
|
|
A form action backend class does not subclass |
|
|
One shared action name is declared in two different modules, so bare-name lookups resolve to whichever module imported first. Rename one class or set |
|
|
A form class |
|
|
|
|
|
|
|
|
A |
|
|
|
|
|
|
|
|
|
|
|
A page-scoped |
|
|
A zone name is declared more than once in a page’s composed template, the layout chain plus the page body. |
|
|
A zone name is not an ASCII slug, so it cannot travel in the latin-1 |
|
|
A |
|
|
A |
|
|
A |
|
|
A component template declares a |
|
|
A custom patch op shadows a built-in verb or uses a name that is not a valid verb token. |
|
|
|
|
|
A composed page template does not compile, so the syntax error would otherwise surface only as a 500 on the first request to the page. |
|
|
A |
|
|
A |
|
|
A |
|
|
A |
|
|
|
|
A code emitted by next.checks.common is produced by a shared helper that the listed subsystem check modules call.
Warnings#
Code |
Condition |
Emitted by |
|---|---|---|
|
A |
|
|
A directory named by |
|
|
|
|
|
An |
|
|
|
|
|
A |
|
|
A form class is declared in a file outside |
|
|
A |
|
|
A |
|
|
Wizards are registered and the configured wizard backend needs Django sessions to store steps, but |
|
|
A static |
|
|
A static |
|
|
Two static wizard steps declare the same field name, so |
|
|
A form action declares |
|
|
A form action declares |
|
|
No |
|
|
A tag library under |
|
|
A |
|
|
A form action backend overrides |
|
|
A partial backend sets |
|
|
A |
|
|
|
|
|
A |
|
|
A registered asset kind names a renderer outside |
|
|
A page or a component registers a keyed |
|
|
A registered asset kind names one of the three bundled renderers together with an |
|
Note
Codes are assigned per check and are not contiguous. Inspect the source of each subsystem module above for the exact message text and trigger conditions.
See also#
See also
Installation for the first manage.py check run.
Troubleshooting for symptoms that map to individual next.* codes.