Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I serve a WSGI Python app using Mongrel2?

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?

like image 861
Brighid McDonnell Avatar asked Oct 14 '11 22:10

Brighid McDonnell


1 Answers

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:

  • LibreList: "State of WSGI handlers?"
  • Hacker News: "Brubeck: a new Python web framework running on Mongrel2"
  • Shedding Bikes: "Mongrel2 Python Library Working"
  • Spike Labs: "Deploying graphite on Mongrel2"
  • Dalton Matos: "Deploying Your Django Application With Mongrel2 and wsgid"
like image 58
Brighid McDonnell Avatar answered Oct 11 '22 13:10

Brighid McDonnell