如何使用 Mongrel2 提供 WSGI Python 应用程序?

发布于 2024-12-09 23:38:29 字数 289 浏览 0 评论 0 原文

这是一次尝试,为目前谷歌搜索起来似乎很难的事情找到一个规范的答案。我正在 Pyramid 中编写一个 Web 应用程序,并且我可以决定我的服务器堆栈的外观。我听说过有关 Mongrel2 的好消息,并且想尝试使用它来为我的应用程序提供服务。但是,我无法从Mongrel2手册和Google搜索中弄清楚如何连接Mongrel2 到 WSGI 应用程序。我是否必须自己推出,或者是否有针对此问题的现有解决方案?

This is an attempt to discover a canonical answer for something that seems to be hard to Google for right now. I am writing a web app in Pyramid, and I have the luxury of deciding what my server stack will look like. I've heard very good things about Mongrel2, and would like to try using it to serve my app. However, I can't figure out from the Mongrel2 manual and Google searches, how to connect Mongrel2 to a WSGI app. Do I have to roll my own, or are there existing solutions to this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

城歌 2024-12-16 23:38:29

为了寻求规范的答案,以下是我在寻找让 Mongrel2 为 WSGI 应用程序提供服务的方法时发现的 WSGI 处理程序。目前看来,wsgid 对于 Django 用户来说是最好的选择,但对于其他用户来说却存在致命缺陷,而且替代方案也存在缺陷。


  • wsgid项目还没有到1.0,但是有很多东西在1.0之前就可以使用了。它周围似乎有一个活跃的社区,这是一个推荐。
  • m2wsgi 处理程序似乎主要是一个人的项目,但它看起来还活着,并且“我开始编写foo 因为我尝试了 bar 和 baz,但它们没有完全解决我的问题”是一个很好的起点,而且它的功能列表看起来不错。
  • GitHub 上的 Mongrel2-WSGI-Handler 项目已经一年多没有提交了,所以虽然它可能有用,但我对此有点警惕。
  • BitBucket 上的 mongrel2_wsgi 项目也已经一年多没有提交了,所以看起来没有也像一个伟大的候选人。
  • Brubeck 是一个基于 Mongrel2 和 Python 构建的完整 Web 框架,看起来很有趣。

关于此主题的其他讨论和帖子:

In pursuit of a canonical answer, here are the WSGI handlers that I've found while looking for a way to get Mongrel2 to serve a WSGI app. Right now, it looks like wsgid is the best bet for Django users, but terminally flawed for others, and the alternatives are flawed.


  • The wsgid project is not yet at 1.0, but there are a lot of things that are usable before 1.0. It seems to have an active community around it, which is a recommendation.
  • The m2wsgi handler appears to mostly be one guy's project, but it looks to be alive, and "I started writing foo because I tried bar and baz and they didn't quite solve my problem" is a good place to start, and its feature-list looks good.
  • The Mongrel2-WSGI-Handler project on GitHub hasn't had a commit in over a year, so while it might be functional, I'm a little wary of it.
  • The mongrel2_wsgi project on BitBucket also hasn't had a commit in over a year, so it doesn't look like a great candidate either.
  • Brubeck is an entire web framework built on Mongrel2 and Python, which looks interesting.

Discussions and posts elsewhere about this topic:

雄赳赳气昂昂 2024-12-16 23:38:29

我写了一篇文章,讨论如何使用 wsgid 设置 mongrel2 来运行 WSGI 应用程序。它在这里:http://daltonmatos.wordpress.com/2011/11/06/deploying-your-django-application-with-mongrel2-and-wsgid/

There is this post I wrote that talks about how to setup a mongrel2 with wsgid to run your WSGI app. It's here: http://daltonmatos.wordpress.com/2011/11/06/deploying-your-django-application-with-mongrel2-and-wsgid/

深空失忆 2024-12-16 23:38:29

您需要使用可以为 WSGI 应用程序提供服务的 Mongrel 2 处理程序。基本上是将消息从 mongrel2 Zeromq 套接字转换为 wsgi 环境的东西。其中有几个,我过去曾成功使用过m2wsgi,但我认为wsgid 看起来也很有前途。

You need to use a Mongrel 2 handler that can serve a WSGI application. Basically something that translates the messages from a mongrel2 zeromq socket into a wsgi environ. There are several of these, I've used m2wsgi successfully in the past, but I think wsgid looks very promising as well.

坦然微笑 2024-12-16 23:38:29

特别是关于 wsgid,您可能需要告诉它加载通用 WSGI 应用程序。您可以在文档中了解有关如何执行此操作的更多信息: 加载通用 WSGI 应用程序,但实现 AppLoader 并不那么困难。

如果您需要任何其他帮助,您可以发送电子邮件至邮件列表,我们将很乐意为您提供帮助。

Specifically about wsgid, you will probably need to tell it to load a generic WSGI application. You can know more about how to do it in the docs: Loading a generic WSGI Application, but implementing an AppLoader would not be that difficult.

If you need any other help you can send an email to the mailing list, will be a pleasure to help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文