开发者

Routing subdomains in Pyramid

开发者 https://www.devze.com 2023-02-16 10:55 出处:网络
In Pylons 1.0 I could go into config/routing.py and add map.connect(\'/\', controller=\'index\', conditions=dict(sub_domain=False))

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='mo开发者_如何学运维bileindex', 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?


An example of what @syrion is referring to is available here:

Multiple domains and subdomains on a single Pyramid instance


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

0

精彩评论

暂无评论...
验证码 换一张
取 消