cgi, reusing html. common problem?

John M. Gabriele john_sips_teaz at yahooz.com
Thu Sep 1 19:47:08 EDT 2005


On Thu, 01 Sep 2005 09:20:51 +0200, Diez B. Roggisch wrote:

> John M. Gabriele wrote:
>> I'm putting together a small site using Python and cgi.
>> 
>> (I'm pretty new to this, but I've worked a little with
>> JSP/servlets/Java before.)
>> 
>> Almost all pages on the site will share some common (and
>> static) html, however, they'll also have dynamic aspects.
>> I'm guessing that the common way to build sites like this
>> is to have every page (which contains active content) be
>> generated by a cgi script, but also have some text files
>> hanging around containing incomplete html fragments which
>> you read and paste-in as-needed (I'm thinking:
>> header.html.txt, footer.html.txt, and so on).
>> 
>> Is that how it's usually done? If not, what *is* the
>> usual way of handling this?
> 
> The basic idea is correct - but there are sooo many other people that 
> had the same problem, and thus they creted web-framworks like e.g. 
> CherryPy or Django or... and then there is ZOPE. Search this group for 
> webframeworks, and you might get more answers than you wanted :)
> 
> Diez


Thanks Diez. Glad to hear I'm on the right track. :)

>From poking around, it looks to me like these Python web
frameworks are to Python as JSP is to Java.

I really don't want to use a "templating language" (a la
JSP) -- I was hoping to just stick with straight Python
and then also html + css. Though I've heard good things
about CherryPy.

Looks like mod_python also comes with it's own solution too:
http://www.onlamp.com/pub/a/python/2004/02/26/python_server_pages.html



-- 
--- if contacting via email, remove zees ---





More information about the Python-list mailing list