[Tutor] Python and PHP

Magnus Lyckå magnus@thinkware.se
Fri Jun 20 16:39:02 2003


At 12:32 2003-06-20 -0700, Gerardo Arnaez wrote:
>I know it does what it does well,

Python or PHP? :)

>but does python have any modules that we can use
>instead to build out page on?

Sure. There are many pythonic ways to avoid the horrors of PHP.

But I don't think looking for a replacement for PHP is really
a good way to formulate the requirements of this new tool.

You have to think about what you want to achieve, what kind
of data you have, how interactive the site will be, how much
it will be used, how complex the logic is etc etc, rather than
what language you want to avoid using. ;)

There are Python solutions that are fairly similar to PHP,
where Python code is embedded in the web pages, and there are
solutions where you mainly write code, and pull in some HTML
templates to get a page layout. There are also frameworks such
as ZOPE where you build your apps interactively in a web
environment.

For some of the available solutions (you have a big selection)
look at:

http://www.python.org/cgi-bin/moinmoin/WebProgramming

There are many options (just as there are many options on how to
do things if you work with PHP, or anything else).

If you tell us more about what you want to do, we can probably
help you narrow it down a bit. We have the fundamentals: It's
a pizza ordering mess that's supposed to be somewhat less of a
mess... :)

Some more relevant factors are:

* Platform/OS/Webserver?

* Can you run whatever processes you like on the servers, or
   are you stuck with something like CGI interfaces?

* Is the interactive user interface only for the pizza buyers,
   or also for the guys who make price lists and create web site
   content also going to use your interactive features?

* Will the site be involved in any kind of monetary transfer, or
   is that handled outside the system. (I guess it's easiest to
   pay in person when the actual pizza is delivered, but I want to
   be sure. It makes a big difference whether you are making money
   transactions in the system or not...)

* What kind of experience do the site developers have?

* What mix of people will be working with development? Programmers,
   layout and content people etc. Will it be the same people who will
   work with the code and the text content, or will there be "content
   providers" who are clueless about programming etc? Roughly how many
   people are involved?

* What load will this site have? How many customers per day, and
   roughly how many hits on the system do they create?

It seems to me that this might be a good fit for Zope. I guess other
solutions, such as CherryPy could fit as well though. It depends on
your answers to the questions above.

Zope is certainly the big player in the field, it has thousands of
users, a number of published books (I think both the "Zope Bible" and
"Zope - Web Application Development and Content Management" are good
books.) The core Python developers are employed by Zope Corp, and work
with the development of Zope.

The disadvantage of Zope is that it's a fairly big and monolithic product,
with a lot of things to learn before you know all of it. On the other hand,
I don't think there is any other tool where you can create a Python based
web application without actually knowing or coding any Python, and there
is an abundance of ready made plugins, so it's a rich component framework.
See http://www.zope.org/Products . For instance, there are several
e-commerce products that you can plug in to your Zope installation.

Zope handles logins, it lets developers make changes and only make these
changes available to the public when they are ready, changes in the
system can be undone, etc etc.

The more advanced your system will eventually be, the more I think you
will gain from using Zope.


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language