如果tile_app是一个wsgi应用程序,你需要像这样返回调用它的结果......
from pyramid.wsgi import wsgiapp
# Enable TileStache tile server
import TileStache
tile_app = TileStache.WSGITileServer('tilestache/tilestache.cfg', autoreload=False)
@wsgiapp
def tileserver(environ, start_response):
return tile_app(environ, start_response)
笔记:我将应用程序创建移至模块级别,以便在导入时创建它,而不是每次处理请求时创建。这可能不是您正在寻找的行为,但大多数时候都是如此。