部署

Pyramid 和 Pylons 的部署是一样的。在“[server:main]”中指定所需的wsgi服务器,并使用它运行“pserver”。 Pyramid 中的默认服务器是waitress,与 Pylons 中的pastehttpserver相比。

Waitress 的优势在于它运行在python 3上。它的缺点是它不会像PastehttpServer那样搜索和销毁阻塞的线程。如果你和我一样,那就足够不在生产中使用 Waitress 了。如果愿意,您可以切换到PastehttpServer或Cherrypy服务器,或者使用类似mod_wsgi这样的不需要python http服务器的方法。