我创建了一个新的Pylons应用程序,并添加了一个带有模板(“index.mako”)的控制器(“main.py”)。现在是URL
http://myserver/main/index
http://myserver/
?
def make_map():
"""Create, configure and return the routes Mapper"""
map = Mapper(directory=config['pylons.paths']['controllers'],
always_scan=config['debug'])
map.minimization = False
# The ErrorController route (handles 404/500 error pages); it should
# likely stay at the top, ensuring it can always be resolved
map.connect('/error/{action}', controller='error')
map.connect('/error/{action}/{id}', controller='error')
# CUSTOM ROUTES HERE
map.connect('', controller='main', action='index')
map.connect('/{controller}/{action}')
map.connect('/{controller}/{action}/{id}')
return map
我还删除了
public
目录(favicon.ico除外),位于
Default route doesn't work