class documentation

A Router is an ordered collection of route->target pairs. It is used to efficiently match WSGI requests against a number of routes and return the first target that satisfies the request. The target may be anything, usually a string, ID or callable object. A route consists of a path-rule and a HTTP method. The path-rule is either a static path (e.g. `/contact`) or a dynamic path that contains wildcards (e.g. `/wiki/<page>`). The wildcard syntax and details on the matching order are described in docs:`routing`.

Method __init__ Undocumented
Method add Add a new rule or replace the target for an existing rule.
Method add_filter Add a filter. The provided function is called with the configuration string as parameter and must return a (regexp, to_python, to_url) tuple. The first element is a string, the last two are callables or None...
Method build Build an URL by filling the wildcards in a rule.
Method match Return a (target, url_agrs) tuple or raise HTTPError(400/404/405).
Class Variable default_filter Undocumented
Class Variable default_pattern Undocumented
Class Variable rule_syntax Undocumented
Instance Variable builder Undocumented
Instance Variable dyna_regexes Undocumented
Instance Variable dyna_routes Undocumented
Instance Variable filters Undocumented
Instance Variable rules Undocumented
Instance Variable static Undocumented
Instance Variable strict_order Undocumented
Method _compile Undocumented
Method _itertokens Undocumented
Constant _MAX_GROUPS_PER_PATTERN Undocumented
Instance Variable _groups Undocumented
def __init__(self, strict=False): (source)

Undocumented

def add(self, rule, method, target, name=None): (source)

Add a new rule or replace the target for an existing rule.

def add_filter(self, name, func): (source)

Add a filter. The provided function is called with the configuration string as parameter and must return a (regexp, to_python, to_url) tuple. The first element is a string, the last two are callables or None.

def build(self, _name, *anons, **query): (source)

Build an URL by filling the wildcards in a rule.

def match(self, environ): (source)

Return a (target, url_agrs) tuple or raise HTTPError(400/404/405).

default_filter: str = (source)

Undocumented

default_pattern: str = (source)

Undocumented

rule_syntax = (source)

Undocumented

Undocumented

dyna_regexes: dict = (source)

Undocumented

dyna_routes: dict = (source)

Undocumented

Undocumented

Undocumented

Undocumented

strict_order = (source)

Undocumented

def _compile(self, method): (source)

Undocumented

def _itertokens(self, rule): (source)

Undocumented

_MAX_GROUPS_PER_PATTERN: int = (source)

Undocumented

Value
99

Undocumented