Source

freehg / htdocs / hgfcgi / dispatch.fcgi

#!/usr/bin/python2.4

import cgitb, sys
sys.path += ['/home/freehg/lib/python']
import os
# hooks need DJANGO_SETTINGS_MODULE set
os.environ['DJANGO_SETTINGS_MODULE'] = 'freehg.settings'

from mercurial.hgweb.hgwebdir_mod import hgwebdir
from mercurial.hgweb.request import wsgiapplication
from fcgi import WSGIServer

cgitb.enable()

def make_web_app():
    return hgwebdir("/home/freehg/hgweb.config")

WSGIServer(wsgiapplication(make_web_app)).run()