[mod_python] migrating to mod_wsgi

Martijn Moeling martijn at xs4us.nu
Wed Feb 24 13:42:10 EST 2010


I have written an adapter for mod_wsgi which is code compatible for Mod_python programs.
My mod_python CMS runs now on top of mod_wsgi without any changes to the code.

It is really small and consists of one index.wsgi to created the req object and call the handler and a "fake" python package for the apache.py, Session.Py, Cookie.py etc. (I did need to change some stuff in there)
I did this for my own use since I like the Req object and to pass it around, so my code is very dependent on MP. I have completely turned over Session.Py for my own session management which stores in MySQL and has License stuff etc.

I consider it Beta since I am the only one running it and do not touch all the code.

This code is free to use by anybody (Be aware it should be GPL or so). At the moment there is no CVS or License simply because I do not have the time to set stuff like that up (never did that before). I just started coding Python with Eclipse and Pydev as preparation on starting CVS use.

Drop me an email if u r interested I'll help you out using email/MSN Messenger/Skype etc.

I do not know about cheetah, I think on that part you can use the parts you are already using.


Regards,

Martijn

On Feb 17, 2010, at 2:46 AM, Alec Matusis wrote:

> We have a high traffic site (thousands HTTP requests per second),  that is
> written with mod_python and Cheetah.
> We are considering migrating some parts of it to mod_wsgi.
> 
> I have a few questions:
> 
> 1) is there a framework or middleware that we can set up, such that the
> existing code that works with mod_python would just work with mod_wsgi?
> 
> 2) This is about new code, that is yet to be written. 
> We only need two simple features from mod_python, namely cookie management,
> and parsing CGI variables submitted via web forms (no session management
> needed, etc). We also need some very basic templating functionality found in
> Cheetah (we could almost get away with string.Template class from pure
> Python, but I'd like to have if and for statements as in Cheetah). I would
> strongly prefer not to use any large framework like Django for several
> reasons (performance, unneeded complexity, security, etc).
> 
> What is the best way to proceed: to wrap basic WSGI into our own
> light-weight cookie management and variable parsing classes, or is there a
> super light-weight and SIMPLE middleware that would do this?
> What would you recommend for templating? We do not want to commit to using
> anything project that would likely become inactive/unsupported soon.
> 
> 
> 
> 
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python




More information about the Mod_python mailing list