Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A very basic WSGI Handler for Mongrel2
Python
branch: master
Failed to load latest commit information.
logs Added logs and tmp directory. Updated README.
run Added the BSD license statement.
tmp Added logs and tmp directory. Updated README.
LICENSE Added the BSD license statement.
README
__init__.py
config.py Made the handler a bit more robust. And added some comments in the code.
test_wsgi_app.py Made the handler a bit more robust. And added some comments in the code.
wsgi-handler.py Fixed path_info header and unquoted the url again so Django does thro…
wsgi.sqlite Fixed path_info header and unquoted the url again so Django does thro…

README

## Basic WSGI Handler for Mongrel2

By: berry.groenendijk@gmail.com
Date: 3 August 2010

This is a very basic WSGI Handler for Mongrel2 (http://mongrel2.org/home). It is based on SimpleHandler from de wsgi reference implementation in Python 2.6 or higher.

The code currently handles a couple of simple WSGI application. It also handles a demo Django WSGI application, see http://github.com/berry/Django-demo.

Known issues:
- this wsgi handler currently doesn't support chunked responses. I haven't figured out yet how to do this.
- [26 aug 2010] since mongrel2 1.0beta1 the wsgi handler doesn't cookies correctly. 
- [26 aug 2010] since mongrel2 1.0beta1 some HTTP posts cause a bad request error. Other HTTP posts do work however.
- [26 aug 2010] since mongrel2 1.0beta1 redirects generated by Django will fail.
- [3 sept 2010] HTTP_HOST header seems to be missing. Django expects it. Need to investigate.

Status of the WSGI handler as of august 2010: only basic simple WSGI applications seems to work correctly. 

Fixed issues:
- [FIXED 4 aug 2010] the handler does not handle query strings correctly right now. Still have to fix and test this.
- [UGLY FIX 4 aug 2010 - Removing BOM(s) before returning the response] Using the Django demo app I get some strange HTML parsing errors in Chrome. It says "Extra <html> encountered...". Which leads to a couple a follow up parsing errors. It apparently has something to do with unicode and a BOM being present in the response data. Strange. Hmmm, the Django development server (./manage runserver) has the same problem.
Something went wrong with that request. Please try again.