Is mod_python 3.1 good for commercial blogging/CMS?

A

Anthony L.

I am writing a web application that is comparable to a content
management system used in blogging. I really want to use Python after
having done some evaluation coding using Python 2.3.5 with mod_python
3.1.4 running on Apache 2.0 with the Publisher handler.

However, I am still very hesitant to settle on Python. All my research
brings up the same collection of scant articles and old mailing list
messages that reference each other. I am not interested in using
frameworks, partly because I am confused by them, but mostly because I
don't want to add another layer of software complexity on top of my code
since I already am expecting a hard time finding low-cost dedicated
hosting with Apache 2 and mod_python 3 support.

I have made a few assumptions regarding Python and mod_python's value.
Hopefully the experts here can help correct any of my assumptions and
give me some more comfort in committing to Python.

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.

2. I have found nothing to quantify the stability and reliability of
mod_python 3, and in the absence of a list of major commercial sites
that use mod_python, I am left feeling as is there might be technical
(read as stability/security) reasons to favor mod_perl over mod_python.

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. Learning
template systems like PyMeld is an unattractive option for me since I
don't understand their benefit. Why can't I just use req.write() to
output my markup, relying completely on external CSS after the fact? 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?

4 A final question, is mod_python 2.7 suitable for use in a commercial
production system? All I'm doing is text processing, string
manipulation, database calls, and some very minor mathematics. If the
Apache 1.3 series mod works fine, can I relieve myself of some stress
and go with that combo?

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?

Anthony
 
B

Ben Sizer

Anthony said:
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.
 
F

Francois Lepoutre

Anthony said:
> I am writing a web application that is comparable to a content
> management system used in blogging. I really want to use Python after
> having done some evaluation coding using Python 2.3.5 with mod_python
> 3.1.4 running on Apache 2.0 with the Publisher handler.

This looks like a resonable choice.
> However, I am still very hesitant to settle on Python. All my research
> brings up the same collection of scant articles and old mailing list
> messages that reference each other. I am not interested in using
> frameworks, partly because I am confused by them, but mostly because I
> don't want to add another layer of software complexity on top of my code
> since I already am expecting a hard time finding low-cost dedicated
> hosting with Apache 2 and mod_python 3 support.

I came to the same conclusion a couple of years ago. Working directly
with the mod_python interpreter ain't that complex. You're guaranteed
to reach great performances whilst using a decent language
(no perl or c here).

When i started to work the publisher was not ready for production,
so i even skipped the thing. No problem. You can code code mod_python
"straight to the metal", the cgi way or use any upper level scheme.
> I have made a few assumptions regarding Python and mod_python's value.
> Hopefully the experts here can help correct any of my assumptions and
> give me some more comfort in committing to Python.
> 1. I want to use CGI through Publisher handler, instead of CGI
> 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.

Caring for performance. That's on your side, as a developper.
mod_python itself will care for its part of the job.
> 2. I have found nothing to quantify the stability and reliability of
> mod_python 3, and in the absence of a list of major commercial sites
> that use mod_python, I am left feeling as is there might be technical
> (read as stability/security) reasons to favor mod_perl over mod_python.

mod_python clearly lacks the kind of recognition (and associated
support) that mod_perl has enjoyed for years.

The documentation is clearly at the level of the product itself.
Win32 support is poor. However is great.
> 3. I am not very attracted to PSP because I want to separate the logic
> from the presentation as completely as possible [...]

In view of your project why not consider cherrypy as well? It may
be an alternative to consider.
> if I minimize my use of req.write() will it make a difference?

The kind of mod_python apps we devised work this way.

Building up the http string (from various sources including db
calls, some caching ..) the old way.

No rocket science here and performance is very decent.
> 4 A final question, is mod_python 2.7 suitable for use in a commercial
> production system? All I'm doing is text processing, string
> manipulation, database calls, and some very minor mathematics. If the
> Apache 1.3 series mod works fine, can I relieve myself of some stress
> and go with that combo?

Why not? But why not work with apache 2.x. mod_python works fine on
this platform.
> 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?

no FUD here. Read the mod_python carefully, run your tests and make up
your choice. This is definitely a workable environment.

Francois
 
J

John J. Lee

Ben Sizer said:
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
[...]

You seem to believe CGI is incompatible with templating. Why? The
two are entirely independent of each other.


John
 
A

Anthony L.

"Ben Sizer said:
What problem? Could you elaborate further?

Hi Ben. This is what I myself am trying to find out. From what I gather,
hosts dislike long running processes, and so one reason for not
supporting Python and mod_python is that, plus multiple instances of the
python interpreter. Granted, a lot of this looks like old information
combined with FUD, so I am suspicious. After all, high-traffic sites
using mod_perl seem okay.
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.

Yes, I see your point. In this case it works for me (at the moment)
because the HTML design will remain as is without subject to editing,
whereas the look and feel (controlled by CSS) will be user-editable.
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.

Okay, I might have been unfair in looking away from PSP then. Thanks Ben.

Anthony
 
A

Anthony L.

3. I am not very attracted to PSP because I want to separate the logic
from the presentation as completely as possible [...]

In view of your project why not consider cherrypy as well? It may
be an alternative to consider.[/QUOTE]

Hi Francois, I'm getting more open to considering other frameworks. As I
mentioned earlier, I am aware that I am swimming against the current by
not simply using Apache 1 and PHP, so I wanted to avoid investing in yet
another esoteric piece of software. Thankfully, after a discussion with
some prospective hosts today, I have the freedom to consider CherryPy
and Django.
Why not? But why not work with apache 2.x. mod_python works fine on
this platform.

Oh, it's not that I have anything against Apache 2. My preference is to
work with mod_python 3, and that requires Apache 2, which I want. I was
just considering a less desirable pythonic option. Even among commodity
shared hosting providers I've found the presence of earlier versions of
python and mod_python.
no FUD here. Read the mod_python carefully, run your tests and make up
your choice. This is definitely a workable environment.

Francois

Thanks Francois. I am going to stick with Python for this. As it turns
out, I'll have the freedom to use the software configuration I want, so
now I don't have to worry about committing to Python, only discover that
my Python code is useable only as a prototype for PHP or Perl. :)

Anthony
 
A

Anthony L.

Ben Sizer said:
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
[...]

You seem to believe CGI is incompatible with templating. Why? The
two are entirely independent of each other.


John

He was just referring to the idea of me perhaps editing the HTML markup
in my Python code using an IDE like Dreamweaver and having a difficult
time. I agree, editing an HTML doc in a WYSIWYG environment would be
easier than me fishing through my req.write() calls and my strings to
find my markup - which is what I am doing at the moment.

Anthony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top