David Z
David Z

Reputation: 131710

Converting from mod_python to mod_wsgi

My website is written in Python and currently runs under mod_python with Apache. Lately I've had to put in a few ugly hacks that make me think it might be worth converting the site to mod_wsgi. But I've gotten used to using some of mod_python's utility classes, especially FieldStorage and Session (and sometimes Cookie), and from a scan of PEP 333, I don't see any equivalents to these. (Not surprising, because I understand that those kinds of utilities don't belong in the WSGI spec)

Question is, are there "standard" (i.e. commonly accepted) replacements for these mod_python utility classes that I can use in WSGI, or could I/should I write my own?

(FYI: currently using Python 2.5)

Upvotes: 11

Views: 5732

Answers (3)

Graham Dumpleton
Graham Dumpleton

Reputation: 58563

You can use FieldStorage in 'cgi' module and the 'Cookie' module. There is no equivalent to Session in Python standard libraries. For WSGI applications you can use Beaker for sessions.

Upvotes: 2

Aaron Watters
Aaron Watters

Reputation: 2846

Please look at whiff -- it provides built in functionality for manipulating field data and sessions among others to wsgi based applications.

Upvotes: 1

S.Lott
S.Lott

Reputation: 391992

Look at Werkzeug. You may have to do some rewriting. You will probably be pleased with the results of imposing the WSGI world-view on your application.

Upvotes: 9

Related Questions