[mod_python] Re: Python CMS with PgSQL

Petri Savolainen petri.savolainen at iki.fi
Mon Dec 8 14:38:59 EST 2003


Jason Tesser wrote:

> I am thinking about developing a CMS with Python and Postgres.  I am developing
> on a Linux box with Apache 2.  I have used PHP in the past but my at work we are
> considering going with Python as our main devellopment language.  A few
> questions for you guys.

Don't reinvent the wheel. Building your own CMS is not a good idea 
unless none of the existing "CMS type" web frameworks do what you need - 
which would be very surprising as there are dozens of them for both PHP 
and Python; do a bit of research and pick one that suits your needs 
best. For python, Zope is the largest and most difficult for someone 
coming from PHP world. There are also many alternatives to a full-blown 
CMS that you may find yourself more comfortable with, such as mod_python 
:-) Also be very careful when you see the word CMS used about a platform 
or product... it is used ultra-liberally in the industry.

> 1. Is it best to just develop in all Pyhton or to use a mixture of PHP and Python? 
> Why orther than personal feelings?

Don't mix languages unless you have to. Keep it simple if you can.

Much of the language issue is nonsense; more important is what is your 
company development model and style than the language that is used. For 
simple (in terms of code complexity and amount of lines) web apps and 
sites, whether you do apache + php + sql is not really that much 
different from apache + mod_python + sql. Both shine doing what they are 
supposed to.

However, if you are moving towards building large systems, or develop 
actual software products, you will find out there are things that are 
not well supported in php or that you simply cannot do.

> 2. What is the best way to template using Python for me to seperate content 
> from logic?  All the data that will be displayed in dynamic so I am not sure 
> what the best way to template it would be in Python.

I would recommend Page Templates; the technology originates from Zope, 
but there are standalone libraries you can use with mod_python, such as 
SimpleTAL/TALES and OpenTAL, and probably others. Note that there is 
also an implementation for PHP that you may find interesting.

I have not tried the templating system being developed for mod_python; 
if you're considering mod_python, you should also try its native 
templating system.

Hope that helps,

  Petri



More information about the Mod_python mailing list