Is mod_python 3.1 good for commercial blogging/CMS?

Ben Sizer kylotan at gmail.com
Tue Nov 8 05:24:12 EST 2005


Anthony L. wrote:
> 1. I want to use CGI through Publisher handler, instead of CGI handler
> or PSP. Despite the speed increase mod_python gives me, there is a
> problem of persistence that can be a problem when dealing with a site
> that will hosts potentially hundreds of simultaneous users.

What problem? Could you elaborate further?

> 3. I am not very attracted to PSP because I want to separate the logic
> from the presentation as completely as possible, and PHP and other
> template languages including PSP seem difficult to do that in.

In theory, people use these templates to /improve/ the separation
between logic and presentation. When you just use req.write() you're
inevitably mixing logic and presentation. At least with the template
systems, you do the presentation once and the logic fills in the gaps.
It's even possible to edit the presentation in many WYSIWYG web editors
without affecting the code.

> Why can't I just use req.write() to
> output my markup, relying completely on external CSS after the fact?

You can, and in fact this is largely what I do. But the HTML/CSS divide
is not exactly in the same place as the template/CGI-style divide. You
can still delegate most of the presentation work to CSS no matter how
you emit your HTML.

It as not easy to work with the CGI-style code in a WYSIWYG web editor
as it is to edit a template, which is probably the main reason for
their use. Also, coding everything with req.write() means that each
page is very idiosyncratic, making for poor code-reuse. In theory.

> My
> thought is that HTML templates provide a minimum set of static code that
> doesn't require extra processing, thus keeping performance up. However,
> if I minimize my use of req.write() will it make a difference?

I don't think performance is a factor, really. HTML templates tend to
exist so that you can structure the page without worrying about the
Python code. They work well for fairly uniform pages that largely
require the same sort of data on each page. I am more of a programmer
than a designer so I prefer to think in terms of code and emit HTML as
it suits me.

> I'd appreciate some practical advise on this. I am funding this myself
> on a small budget with no hard deadline, so it is critical to me that I
> choose a language that will minimize my costs. Are my assumptions
> correct, or am I falling prey to FUD?

Python is a good language for rapid development and hence testing. So
you could probably create a quick mock-up of your system and then write
some scripts to place it under heavy stress to see how well it holds
up.

-- 
Ben Sizer




More information about the Python-list mailing list