Utils Reference

Module Summary

next.utils exposes two helpers that project code can import: resolve_base_dir and classify_dirs_entries. The module also defines a registration-internal frame helper that the framework uses to attribute decorated callables to their defining file. That helper is not part of the public surface and is excluded from the autodoc table below.

resolve_base_dir returns settings.BASE_DIR coerced to pathlib.Path, or None when it is unset, for backends that resolve project-relative paths. classify_dirs_entries splits a backend DIRS list into existing directory roots and plain skip-name segments, the same split the file router applies.

Public API

Filesystem path helpers.

next.utils.resolve_base_dir() Path | None[source]

Return settings.BASE_DIR as a pathlib.Path, or None.

next.utils.classify_dirs_entries(entries: list[Any] | tuple[Any, ...] | None, base_dir: Path | None) tuple[list[Path], frozenset[str]][source]

Split DIRS into directory roots and URL segment names (file router).

See Also

See also

File Router documents the DIRS semantics that classify_dirs_entries supports.