[mod_python] modpython psp v. spyce

David McNab david at rebirthing.co.nz
Sun Mar 7 12:06:26 EST 2004


As someone who spent a year writing in PHP, then switched to Python, I 
missed the ability to 'execute' an HTML file with code embedded.

I came across Spyce, and even wrote my own Python-in-HTML preprocessor.

However, I'm since come to feel - and this is a personal thing - that 
the very notion of embedding code within HTML is fraught with severe 
suckage.

I worked with the PHP-Nuke software, and even published a few add-ons 
for it.

For small jobs, (and jobs which stay small), embedding code into HTML 
has its appeal.

But as a web app grows into any level of sophistication, this whole 
approach can give rise to some abominably messy code.

So these days, I use a tag class library, and generate the HTML purely 
from code. To me now, raw HTML feels like the 'assembly code', or even 
the 'machine code', of web programming. I'm much preferring the ability 
to build pages as a hierarchy of abstract widgets, where each 'widget' 
is a class which ultimately renders down to HTML code.

Lately, I've just finished the first cut of a web app framework called 
pyweb.gui. As soon as I finish the documentation, I'll announce an alpha 
  to this and other lists. Early trials of pyweb.gui have seen me able 
to build active web pages in a fraction of the time, and end up with 
stateful web apps that can run identically over traditional CGI, 
mod_python CGI, mod_python with custom handler or standalone server.

pyweb.gui one one hand is 'just another' python web app framework. But 
on the other hand, it is one of the few that can be deployed on even the 
  cheapest and most restrictive web hosts.

So I ask people to question whether embedding code into HTML, 
particularly with such a beautiful and powerfully-OO language like 
Python, is really a desirable direction to go in.

Cheers
David

--

leave this line intact so your email gets through my junk mail filter


More information about the Mod_python mailing list