[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial
Subject:    Re: hgwebdir with mod_python
From:       Dirkjan Ochtman <dirkjan () ochtman ! nl>
Date:       2007-05-21 23:23:15
Message-ID: f2t9lc$nm7$1 () sea ! gmane ! org
[Download RAW message or body]

Dirkjan Ochtman wrote:
> Given this function, it should also be easy to use the newer mod_wsgi 
> Apache module, available from code.google.com/p/modwsgi.

Here is my code for hg.wsgi, which can be used with mod_wsgi:

from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import _wsgirequest

class WSGIApplication(object):

         def __call__(self, environ, start_response):
		hwd = hgwebdir('/var/hg/hg.config')
                 return _wsgirequest(hwd, environ, start_response)

application = WSGIApplication()

Unfortunately, there's a problem with a Content-Length header being 
submitted for static files. This was fixed in 4038:5ae460b1f6f0 on 
selenic.com/hg, but it's not in hg-stable, for example. Maybe it can be 
pulled over to stable? Also, it would be very nice if there was a more 
recent release with little fixes like this one.

Regards,

Dirkjan

_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic