class Subdomain(RuleFactory):
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 |
Undocumented
Parameters | |
subdomain:str | Undocumented |
rules:t.Iterable[ | Undocumented |
werkzeug.routing.RuleFactory.get_rules
RuleFactory
have to override this method and return
an iterable of rules.Parameters | |
map:Map | Undocumented |
Returns | |
t.Iterator[ | Undocumented |