在 Tornado 下运行 Pyramid WSGI 应用程序 [英] Running a Pyramid WSGI application under tornado

查看:56
本文介绍了在 Tornado 下运行 Pyramid WSGI 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Pyramid 使用它自己的 Waitress Web 服务器进行开发,但我想在 Tornado 下为我的 WSGI 应用程序提供服务.我想我应该使用 pserve .ini 文件配置它,但我无法让它工作

Pyramid uses it's own Waitress web server for development purposes, but I want to serve my WSGI app under Tornado. I think I should configure it using the pserve .ini files, but I can't get it to work

推荐答案

Pyramid 应用程序可以轻松地从 INI 文件加载.从那里,您只需将 wsgi 应用程序传递到 Tornado 的 WSGIContainer.

The Pyramid application can be loaded from the INI files easily. From there you just pass the wsgi app into Tornado's WSGIContainer.

from pyramid.paster import get_app

app = get_app('development.ini')
container = tornado.wsgi.WSGIContainer(app)

这篇关于在 Tornado 下运行 Pyramid WSGI 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆