473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Is mod_python 3.1 good for commercial blogging/CMS?

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
Nov 7 '05 #1
6 1918
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

Nov 8 '05 #2
Anthony L. wrote:
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
Nov 8 '05 #3
"Ben Sizer" <ky*****@gmail.com> writes:
[...]
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

Nov 8 '05 #4
In article <11**********************@g14g2000cwa.googlegroups .com>,
"Ben Sizer" <ky*****@gmail.com> wrote:
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?


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
Nov 9 '05 #5
In article <43***********************@nan-newsreader-07.noos.net>,
Francois Lepoutre <fr***************@caramail.com> wrote:
> 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.


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.
> 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.


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
Nov 9 '05 #6
In article <ma**************************************@python.o rg>,
jj*@pobox.com (John J. Lee) wrote:
"Ben Sizer" <ky*****@gmail.com> writes:
[...]
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
Nov 9 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tim | last post by:
....just starting to work with mod_python. There are a number of details and pitfalls: any suggestions on where to get some decent tips and tricks. I can comprehend the provided docs but...they are...
1
by: Rolfe | last post by:
Hi, I struggled, and got mod_python running on Apache/Win2k. Follow these instructions verbatim and you shouldn't have any trouble. These instructions are based on...
1
by: wolf | last post by:
i would like to briefly share my experiences with installing mod_python on a w2000 box. i must say that i believe the installation process to be unnecessarily complicated by the simple fact that...
1
by: Nancy | last post by:
Hi, I follow the Mod_python manual and try to let my form.py to handle html form. The form.html and form.py are copied from http://www.modpython.org/live/current/doc-html/tut-pub.html, after I...
3
by: flab ba | last post by:
Hello: I am new to web app programming, but need to create a web app. I would like to do it in Python After extensive googling, reading news groups, blogs, and outdated / incomplete "web app...
1
by: David Bear | last post by:
I will be running zope, and I would also like to run mod_python. The problem arised when zope wants a threaded version of python and mod_python wants no_threads. I've been searching the...
2
by: Robert J. Hansen | last post by:
I'm not entirely certain comp.lang.python is the proper newsgroup for mod_python questions, but "comp.lang.python.web" doesn't seem to exist, so... my apologies in advance if this is considered...
1
by: treelife | last post by:
I'm getting and internal server error when | run the following mod_python script. I am actually trying to run Django. Script: from mod_python import apache def handler(req):...
3
by: yinglcs | last post by:
Hi, I am trying to setup Apache with Trac which uses mod_python. I get the following error: assert have_pysqlite 0 And I have verify this via command line as well, that seem no problem....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.