annotate wiki/server/moin_flup_wsgi.py @ 3015:8d691fbdc929

WSGI: initialize logging (untested) (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Jan 2008 20:06:00 +0100
parents 70f2d676920b
children 806cf4814612
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 """
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
2 MoinMoin - Moin as WSGI application with flup as fcgi gateway
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
4 @copyright: 2005 by Anakim Border <akborder@gmail.com>,
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
5 2007 by MoinMoin:ThomasWaldmann
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
6 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
7 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
9 use_threads = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10 unixSocketPath = '/tmp/moin.sock'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
11
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
12 import os
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
13 import logging
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
14
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
15 # Set threads flag, so other code can use proper locking
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16 from MoinMoin import config
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
17 config.use_threads = use_threads
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
18 del config
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
19
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
20 from flup.server.fcgi import WSGIServer
3015
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
21 from MoinMoin.server.server_wsgi import moinmoinApp, WsgiConfig
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
22
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
23 class Config(WsgiConfig):
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
24 logPath = 'moin.log' # adapt to your needs!
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
25 #loglevel_file = logging.INFO # adapt to your needs!
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
26
8d691fbdc929 WSGI: initialize logging (untested) (port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2972
diff changeset
27 config = Config() # MUST create an instance to init logging
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
28
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
29 if __name__ == '__main__':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
30 server = WSGIServer(moinmoinApp, bindAddress=unixSocketPath)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
31 server.run()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
32 os.unlink(unixSocketPath)
643
8ed1a953d12e fix the server adaptor scripts to hopefully match the new request module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 0
diff changeset
33