Skip to main content

get_ns_resolver

Build a namespaced resolver for the given parent URLconf pattern.

def get_ns_resolver(
ns_pattern: str,
resolver: URLResolver,
converters: dict
) - > URLResolver

Builds a namespaced resolver for the given parent URLconf pattern, enabling the use of captured parameters within the parent pattern.

Parameters

NameTypeDescription
ns_patternstrThe regex pattern string representing the namespace prefix to be applied.
resolverURLResolverThe existing URL resolver whose patterns will be wrapped within the new namespace.
convertersdictA mapping of path converter names to their respective converter instances for parameter transformation.

Returns

TypeDescription
URLResolverA nested URLResolver instance configured with the namespaced pattern and the original resolver's URL patterns.