cgi, reusing html. common problem?
Walter Dörwald
walter at livinglogic.de
Thu Sep 1 13:10:14 EDT 2005
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?
I don't know if it's the *usual* way, but you could give XIST a try
(http://www.livinglogic.de/Python/xist). It was developed for exactly
this purpose: You implement reusable HTML fragments in Python and you
can use any kind of embedded dynamic language (PHP and JSP are supported
out of the box).
Bye,
Walter Dörwald
More information about the Python-list
mailing list