class documentation

class Subdomain(RuleFactory):

View In Hierarchy

All URLs provided by this factory have the subdomain set to a specific domain. For example if you want to use the subdomain for the current language this can be a good setup:

url_map = Map([
    Rule('/', endpoint='#select_language'),
    Subdomain('<string(length=2):lang_code>', [
        Rule('/', endpoint='index'),
        Rule('/about', endpoint='about'),
        Rule('/help', endpoint='help')
    ])
])

All the rules except for the '#select_language' endpoint will now listen on a two letter long subdomain that holds the language code for the current request.

Method __init__ Undocumented
Method get​_rules Subclasses of RuleFactory have to override this method and return an iterable of rules.
Instance Variable rules Undocumented
Instance Variable subdomain Undocumented
def __init__(self, subdomain, rules):

Undocumented

Parameters
subdomain:strUndocumented
rules:t.Iterable[RuleFactory]Undocumented
def get_rules(self, map):
Subclasses of RuleFactory have to override this method and return an iterable of rules.
Parameters
map:MapUndocumented
Returns
t.Iterator[Rule]Undocumented
rules =

Undocumented

subdomain =

Undocumented