view MoinMoin/server/server_wsgi.py @ 3105:80e1a910a2f1

make logging more configurable and flexible, packages/modules shall call MoinMoin.server.getLogger
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 23 Feb 2008 21:43:47 +0100
parents 103fd9035d50
children c6e39279f83b
line wrap: on
line source
"""
    MoinMoin - WSGI application

    Minimal code for using this:

    import logging
    from MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp

    class Config(WsgiConfig):
        pass

    config = Config() # you MUST create an instance to initialize logging!
    # use moinmoinApp here with your WSGI server / gateway

    @copyright: 2005 Anakim Border <akborder@gmail.com>,
                2007 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

from MoinMoin.server import Config
from MoinMoin.request import request_wsgi

class WsgiConfig(Config):
    """ WSGI default config """
    pass


def moinmoinApp(environ, start_response):
    request = request_wsgi.Request(environ)
    request.run()
    start_response(request.status, request.headers)
    return [request.output()]