0
如何成为像CSS静态文件使用WERKZEUG和纯GEVENT静态文件渲染
蟒蛇..没有使用框架编写的应用程序WSGI ..
这是我的服务器..
from gevent import pywsgi
from Index import application
import os
application = SharedDataMiddleware(application, {
'/hello/template/': os.path.join(os.getcwd(), 'template')
})
print 'Serving on https://127.0.0.1:4000'
server = pywsgi.WSGIServer(('0.0.0.0', 4000), application,spawn=10000)
# to start the server asynchronously, call server.start()
# we use blocking serve_forever() here because we have no other jobs
server.serve_forever()
模板是路径,如CSS和图像静态文件。但是这仅仅是服务于应用,而不是静态文件。有其中GEVENT提供静态文件的功能..?我没有找到的文档非常有用。