[mod_python] bye bye mod_python, hello... what?

mog lists at elasticmind.net
Tue Jan 12 14:00:56 EST 2010


On 12/01/2010 14:09, Geert Dekkers wrote:
> How about mod_wsgi (http://code.google.com/p/modwsgi/) ???
> Geert
>
> On Jan 12, 2010, at 2:56 PM, Clodoaldo Neto wrote:
>
>    
>> 2010/1/12 mog<lists at elasticmind.net>:
>>      
>>> So, the time has come. I need to start a new project and also migrate my old
>>> mod_python stuff to something else :(
>>>
>>> After all the sweat, blood and tears I put into learning about how Python
>>> web apps work, learning how to use mod_python, and how to put web apps
>>> together (using mod_python). It's really sad to think that a good portion of
>>> that effort seems lost because, unfortunately, mod_python is deprecated :(
>>>
>>> I looked at a few web frameworks but found they either simply didn't work,
>>> exhibited weird random unpredictable behaviour that was impossible to work
>>> with, or seemed to abstract so far away from real HTTP which made me feel
>>> uncomfortable. I finally settled on mod_python because it seemed to be a
>>> nice balance of powerful functionality and usefulness - oh, and it worked.
>>>
>>> With mod_python I felt as though I was working closely with the HTTP
>>> requests because I could use the request objects directly and, if I wanted
>>> (and I did), stick stuff in them to use in sessions. mod_python seemed
>>> pretty raw, but not so much so that I had to write my own request handlers
>>> and all the nitty gritty things like that (which, being new to web
>>> development, was and probably still is beyond my ability to do well and
>>> securely). I liked it because it also provided lots of in-built utilities
>>> making it really easy to do session handling, redirection and so on.
>>>
>>> I'm trying to avoid using one of the mainstream frameworks because I feel
>>> they overcomplicate things, bloat things up, and abstract too much away from
>>> what is really going on. Many of them annoyingly also end up requiring a
>>> bazillion dependencies to install. Personally I like to use small and
>>> compact programs that are really good at doing the small number of things I
>>> need them to, as opposed to installing some giant application (and all its
>>> dependencies) that can do everything under the sun I'll never use.
>>>
>>> With all this in mind. I was hoping someone would please be so kind as to
>>> recommend things that I could use instead of mod_python as a WSGI layer, but
>>> that hopefully works in a similar way to mod_python?
>>>        
>> You could start trying Werkzeug which calls itself "a simple
>> collection of various utilities for WSGI applications".
>>
>> http://werkzeug.pocoo.org/
>>
>> Then WebOb:
>>
>> http://pythonpaste.org/webob/
>>
>> Regarding small and simple I think the two above are some of the best
>> approaches but don't expect something like the mod_python's publisher
>> handler.
>>
>> Regards, Clodoaldo
>>
>>      
>>> Thank you in advance for your time and consideration.
>>>
>>> Kind regards,
>>> mog


Sorry guys, I think it would have helped for me to be a bit more specific.

I am definitely going to be using mod_wsgi as the the Python/Apache 
interpreter; in fact, I installed and tested mod_wsgi last night on my 
server - it seems to work just fine.

What I wasn't sure about were the ways in which mod_wsgi is different to 
mod_python. For example, my app would make use of mod_python's session 
support and put a user_id into the request object so it was persistent 
(accessing the request info directly). It would also use internal 
redirects for pages that required authentication; so if a user needed to 
log in first, it would automatically show them a login screen and then 
take them to their requested page following a successful login.

I was under the impression that mod_wsgi did not provide similar 
functionality for these common things for me to use (like mod_python 
does). So I'd need to use some kind of utilities or "framework" to help 
me with this. I guess what I was really asking for advice on was: what I 
might be able to use to help me effectively migrate from mod_python to 
mod_wsgi... It seems as though Werkzeug might be promising.

Thanks to everyone who replied and offered advice/suggestions, it is 
greatly appreciated.

Kind regards,
mog


More information about the Mod_python mailing list