librelist archives

« back to archive

State of WSGI handlers? (esp w/ django)

State of WSGI handlers? (esp w/ django)

From:
Matt N
Date:
2011-02-02 @ 17:54
I've found these:

http://github.com/rfk/m2wsgi/
https://bitbucket.org/dholth/mongrel2_wsgi
https://github.com/berry/Mongrel2-WSGI-Handler


Anybody know of any others?

I need to be able to have django running alongside tir behind mongrel2.  
Wondering if anyone has any experience or success/failure stories or if I 
should just try them all.

Thanks,

Re: [mongrel2] State of WSGI handlers? (esp w/ django)

From:
berry groenendijk
Date:
2011-02-02 @ 20:28
Hi Matt,

I am the author of https://github.com/berry/Mongrel2-WSGI-Handler. This WSGI
server is probably not the best implementation. I just re-used the standard
Python WSGI server. Just the very basic stuff works. There are probably
better WSGI handlers for mongrel out there.

Berry


On Wed, Feb 2, 2011 at 6:54 PM, Matt N <mtnngw@gmail.com> wrote:

> I've found these:
>
> http://github.com/rfk/m2wsgi/
> https://bitbucket.org/dholth/mongrel2_wsgi
> https://github.com/berry/Mongrel2-WSGI-Handler
>
>
> Anybody know of any others?
>
> I need to be able to have django running alongside tir behind mongrel2.
>  Wondering if anyone has any experience or success/failure stories or if I
> should just try them all.
>
> Thanks,
>
>
>

Re: [mongrel2] State of WSGI handlers? (esp w/ django)

From:
Ryan Kelly
Date:
2011-02-02 @ 21:23
On Wed, 2011-02-02 at 09:54 -0800, Matt N wrote:
> I've found these:
> 
> 
> http://github.com/rfk/m2wsgi/
> https://bitbucket.org/dholth/mongrel2_wsgi
> https://github.com/berry/Mongrel2-WSGI-Handler
> 
> 
> 

That first one's mine.  I've been trialling it alongside our production
server (apache/mod_wsgi) and it seems to do the job, but it's very new
code so I won't be surprised if there are some rough edges.

One nice feature that I believe is unique to m2wsgi is its handling of
large uploads.  It allows you to read the request body from
environ['wsgi.input'] while it is still being streamed to a tempfile by
mongrel2.

If you do wind up going with m2wsgi, don't try to use its "XREQ" send
socket in production.  That was an interesting experiment but it's got
too many potential failure modes, I am going to pull the good bits out
into something else.

> I need to be able to have django running alongside tir behind
> mongrel2.

I use m2wsgi with django's wsgi handler with no problems.

> Wondering if anyone has any experience or success/failure stories or
> if I should just try them all.

Obviously I think mine's the nicest, but it's probably worth trying them
all.  Shouldn't take long if you already have django set up to be served
by WSGI.

The one by dholth is based on the WSGI server from the CherryPy project,
so the HTTP-handling stuff is very robust and tested code.  But be aware
that it uses eventlet for its threading so your code will have to be
compatible with eventlet.  Might rule out using e.g. MySQL with your
django.


  Cheers,

     Ryan

-- 
Ryan Kelly
http://www.rfk.id.au  |  This message is digitally signed. Please visit
ryan@rfk.id.au        |  http://www.rfk.id.au/ramblings/gpg/ for details

Re: [mongrel2] State of WSGI handlers? (esp w/ django)

From:
Daniel Holth
Date:
2011-02-02 @ 21:59
> > https://bitbucket.org/dholth/mongrel2_wsgi
>

is mine. It is a pretty straightforward hack of the CherryPy WSGI server to
Mongrel2. It has unit tests and it supports chunked responses. It does not
do anything about uploads and I do not use it personally; I only wrote it to
decide whether mongrel2 was interesting (it was) but I have not put it into
production. I am not a Django user.

The eventlet support is a very small detail.

Daniel