Configuration Reference¶
Module Summary¶
next.conf merges user NEXT_FRAMEWORK settings with framework defaults.
It exposes the merged-settings object, the import helpers, the extend_default_backend helper, and the settings_reloaded signal.
Public API¶
Settings Class¶
Merged view of settings.NEXT_FRAMEWORK with framework defaults.
The NextFrameworkSettings class reads the user mapping lazily and merges it with DEFAULTS on first access. Merge results are cached until reload() drops the cache and emits settings_reloaded. Package managers that depend on the merged values subscribe to that signal and reset their own state.
- class next.conf.settings.NextFrameworkSettings[source]¶
Lazy merged view of top-level keys declared in DEFAULTS.
- DEFAULTS: ClassVar[dict[str, Any]] = {'DEFAULT_COMPONENT_BACKENDS': [{'BACKEND': 'next.components.FileComponentsBackend', 'COMPONENTS_DIR': '_components', 'DIRS': []}], 'DEFAULT_FORM_ACTION_BACKENDS': [{'BACKEND': 'next.forms.RegistryFormActionBackend', 'OPTIONS': {}}], 'DEFAULT_PAGE_BACKENDS': [{'APP_DIRS': True, 'BACKEND': 'next.urls.FileRouterBackend', 'DIRS': [], 'OPTIONS': {'context_processors': []}, 'PAGES_DIR': 'pages'}], 'DEFAULT_STATIC_BACKENDS': [{'BACKEND': 'next.static.StaticFilesBackend', 'OPTIONS': {}}], 'JS_CONTEXT_SERIALIZER': None, 'LAZY_COMPONENT_MODULES': False, 'NEXT_JS_OPTIONS': {}, 'STRICT_CONTEXT': False, 'TEMPLATE_LOADERS': ['next.pages.loaders.DjxTemplateLoader'], 'URL_NAME_TEMPLATE': 'page_{name}'}¶
Defaults¶
Framework-level defaults for the settings.NEXT_FRAMEWORK mapping.
The values stored here are deep-copied into the merged view on every reload. Nothing in this module imports from the rest of the framework, which keeps the configuration layer at the bottom of the dependency graph.
Helpers¶
Helpers for writing compact NEXT_FRAMEWORK settings blocks.
- next.conf.helpers.extend_default_backend(key: str, *, index: int = 0, **overrides: Any) list[dict[str, Any]][source]¶
Return a NEXT_FRAMEWORK[key] list with one backend entry patched.
The returned list is a deep copy of the default entries with the entry at index updated by overrides. Nested dicts such as OPTIONS are merged instead of replaced so partial overrides do not drop adjacent keys.
Raises ImproperlyConfigured when key is not a known backend-list setting. Raises IndexError when index is out of range for the default list.
Import Utilities¶
- next.conf.imports.import_class_cached(dotted_path: str) type[Any][source]¶
Import a class by dotted path and cache it until the cache is cleared.
Signals¶
See Signals Reference for the settings_reloaded signal.