Refactor MoinMoin's request package to WSGI (only)

This page tries to summarize some suggestions that were (roughly) discussed elsewhere.

The general idea is to clean up MoinMoin.request, which currently supports all sorts of request methods (like cgi, fastcgi, wsgi, mod_python, twisted, standalone, cli). Maintaining and testing this code is a problem, as most developers only use 1 or 2 of these methods, but not all. Also, the code primarily lacks a clean separation of various bits of the request handling.

But before any work in this are is done, there needs to be a good plan, that covers everything from code to documentation.

Basics of moin as a WSGI application

For the user, nothing would change.

TODO

Code

moin already supports wsgi, so for the code it is primarily testing what is needed:

After going WSGI-only, some code maybe can be optimized / refactored more easily because of this.

(!) The standalone server should be also switched to use WSGI for the wiki part, the static resources part has to be implemented somehow also.

Docs

I do not see why docs would change a lot. Just the mod_py users will have to be advised to search for a wsgi-adaptor.

General notes about install docs:

any cgi (apache, IIS, lighttpd, ...)

moin.cgi could be changed to use wsgiref.handlers.CGIHandler.

For Python >= 2.3 , we can use wsgiref for py 2.3 and 2.4 and include it in moin distribution. After we require Python 2.5, this can be satisfied from the python stdlib and wsgiref can be removed from moin dist.

apache/ lighttpd via fastcgi or scgi

It makes sense to ship the modified flup that can be found in the trac distribution for various reasons (bugs in flup etc.)

apache / mod_python

There are various adapters that the users will be able to use, e.g. paste.modpython

apache / mod_wsgi

No change needed.

IIS / isapi or asp

Use isapi_wsgi, asp_wsgi, the shipped flup, etc. pp.

twisted

twisted_wsgi or twisted.web2 (twisted_wsgi2)?

standalone

We can probably replace our standalone "moin.py" server by a wsgiref.simpleserver.

For Python >= 2.3 , we can use wsgiref for py 2.3 and 2.4 and include it in moin distribution. After we require Python 2.5, this can be satisfied from the python stdlib and wsgiref can be removed from moin dist.

For the static stuff, maybe use Luke Arno's "static" lib. static.Shock sounds interesting for mixed serving of static and dynamic content (and you maybe even could replace a wiki page by a static file in case you want to).

Open questions:

Alternatively, we could use paste.httpserver - supporting ssl and multithreading.

Or rather invoke: paster serve (using wsgiserver or wsgiutils_server)

cli

?

(unit testing)

paste.debug.testserver

Cf. paste fixture

Ideas

Other pages in this wiki:

External:


CategoryFeatureImplemented

MoinMoin: FeatureRequests/WsgiRefactoring (last edited 2009-01-07 01:02:29 by ThomasWaldmann)