[mod_python] mod_python not supported, switching from mod_python to wsgi

Dave Britton dave at davebritton.com
Sat Aug 29 11:52:35 EDT 2009


Azhaguselvan,SP wrote:
> Why is mod_python not supported? I thought this mailing list is for such
> a cause?

According to Graham Dumpleton, who is the expert on this and the last
technically knowledgeable person answering questions on this list, there are
no developers willing to work on mod_python any more. Apparently there is
too much work involved to bring mod_python up to speed on the newest
versions of apache and python. So, mod_python installations that need to
stay on older versions of apache legacy installations will continue to work,
but no one can expect continuing technical development or support. Graham is
recommending that people who want to use python as their back-end web
scripting language shift to mod_wsgi, as this has now got pretty widespread
support in a number of templating and framework systems. You might want to
investigate what would be involved in porting your mod_python system to
wsgi, as it could be easier than you think. Here's an example I got from the
web:
=====================================
http://stackoverflow.com/questions/596729/how-do-i-use-python-for-web-develo
pment-without-relying-on-a-ramework/596988

The way to go is wsgi.

WSGI is the Web Server Gateway Interface. It is a specification for web
servers and application servers to communicate with web applications (though
it can also be used for more than that). It is a Python standard, described
in detail in PEP 333.
All current frameworks support wsgi. A lot of webservers support it also
(apache included, through mod_wsgi). It is the way to go if you want to
write your own framework.
Here is hello world, written to wsgi directly:
def application(environ, start_response):    status = '200 OK'
response_headers = [('Content-type','text/plain')]    start_response(status,
response_headers)    return ['Hello world!\n']
Put this in a file.py, point your mod_wsgi apache configuration to it, and
it will run. Pure python. No imports. Just a python function.
If you are really writing your own framework, you could check werkzeug. It
is not a framework, but a simple collection of various utilities for WSGI
applications and has become one of the most advanced WSGI utility modules.
It includes a powerful debugger, full featured request and response objects,
HTTP utilities to handle entity tags, cache control headers, HTTP dates,
cookie handling, file uploads, a powerful URL routing system and a bunch of
community contributed addon modules. Takes the boring part out of your
hands.
==============================
I have a lot of code written for the mod_python publisher system, and I
found mod_wsgi wasn't very hard to set up. I have started a django
application with mod_wsgi, and I expect to set up werkzeug with mod_wsgi for
converting my older code.
Googling around shows a lot of people using cheetah under cherrypy and
mod-wsgi. Set up a server with this and see if your cheetah template code
just works. It should.
-Dave

----- Original Message -----
From: "Azhaguselvan" <selva4210 at gmail.com>
To: "Dave Britton" <dave at davebritton.com>
Sent: Saturday, August 29, 2009 2:16 AM
Subject: Re: [mod_python] Doubt regarding form handling in mod_python


> Hi,
> > BTW:  since you are using cheetah, you should consider switching from
> > mod_python to mod_wsgi as mod_python is no longer being actively
developed
> > or supported, and cheetah has support for wsgi.
> > -Dave
> >
> >
> Thanks for the reply. We have hefty ERP portal running in the
> mod_python+cheetah combo. It is not that easy to change to mod_wsgi I
> think??
>
> Why is mod_python not supported? I thought this mailing list is for such
> a cause?
>
> Regards,
> Azhaguselvan,SP
>



More information about the Mod_python mailing list