Python instead of php

Gerhard Häring gerhard.haering at gmx.de
Sat Nov 16 10:13:14 EST 2002


Marten Bauer wrote:
> Hello to ya all,
> 
> i use python for programming a database (postgresql) project. 
> The Systeminterfaces are written in python and the Userinterface 
> (web based) is written in html/php.
> 
> Is it possible to use python like php as script language to writte
> the Userinterfaces also in html and python?

Of course. Wether or not "using Python like PHP" i. e. using
code-in-html is a good idea is another interesting question. [1]

> Is modpython for apache or Twisted from Tweak Labroratory a possible
> way?

Both are tools that can help you doing so. But both Twisted.Web and
mod_python are pretty low-level. You'll probably need an additional
library to do the usual stuff like session handling for you.

Of course, there are complete web application frameworks, Webware only
being one of them. You might want to take a look at this Wiki page:
http://www.python.org/cgi-bin/moinmoin/WebProgramming for the
overwhelming possibilites.

There are several solutions that come pretty close to PHP, for example
Spyce (http://www.python.org/cgi-bin/moinmoin/Spyce).

-- Gerhard

[1] http://www.python.org/cgi-bin/moinmoin/PresentationTechnologies



More information about the Python-list mailing list