[mod_python] Thread safety

Jorey Bump list at joreybump.com
Tue Jun 7 21:06:24 EDT 2005


mike bayer wrote:

> are any of those publishers framework-agnostic (i.e. work in other
> containers besides mod_python) ?   theres a great advantage to being able
> to move an application over to other web environments, such as standalone
> servers, lighttpd etc. either for performance testing or development. 

If you separate your core functionality properly, portability isn't much 
of an issue. Publishers and frameworks are best treated as simple 
interfaces to more complex code. Although it's possible to build entire 
applications with them, it's probably not a good idea.

For example, I have a few packages that handle db routines, HTML 
generation, proprietary authentication systems, etc. These are too 
site-specific to be part of the standard library, but are essential to 
the work I do, so I keep them in my PYTHONPATH. As a result, my 
mod_python.publisher applications tend to be very small, and I suspect 
that I could easily reimplement them in Vampire, mpservlets, CGI, or 
even as standalone Python applications with embedded HTTP servers.

More ambitious frameworks try to shield you from the development 
language entirely ("Edit your web site without any knowledge of HTML!") 
and should be considered as entirely proprietary. That's not a 
criticism, as it's usually the goal, but it's worth pointing out that it 
represents the furthest point of the spectrum. All ye who enter this 
land shall forsake portability. :)


More information about the Mod_python mailing list