Search code examples
pythonurlurl-routingpylonspyramid

Routing subdomains in Pyramid


In Pylons 1.0 I could go into config/routing.py and add

map.connect('/', controller='index', conditions=dict(sub_domain=False))
map.connect('/', controller='mobileindex', conditions=dict(sub_domain='m'))

to route m.mydomain.com to a different controller, but still use the same app. Can I do the same in Pyramid?


Solution

  • Theoretically, this is covered by add_route() with a pregenerator argument.