HTML Templates (Sitemesh/Tiles concept) in Python

bruno de chez modulix en face bruno at modulix.org
Mon Oct 23 16:42:49 EDT 2006


Suren a écrit :

> > Python with ? CGI ? FastCGI ? mod_python ? Other ?
>
> We are using mod_python and SSI.
>
> We are inheriting some legacy code
> that we do not want to mess with at all.

Ok.

> > You shouldn't - unless this is an internal web-based application, not a
> > public site. Since your dynamically generating the pages, there's no
> > gain using frames - but there are huge drawbacks, for the programmers as
> > well as for the visitors.
>
> Although not an internal site, this site is going to be in a controlled
> environment. Only a handful of people may access the website.

So the drawbacks of frames may not be a definitive show-stopper.
Anyway, and unless going thru useless complications, frames still have
at least 2 big problems : you cannot bookmark pages, and you cannot be
sure the use will see the effective content thru the "framed"  page.
The main use case for frames is (was ?) to avoid duplicating the same
set of common elements (menus, header, footer etc) on each and evry
page of a site. With dynamic page generation and template systems, this
is no more a problem, so I see very few reasons to still use them.

(snip)

> >
> > > Any other tips to help life easier are appreciated.
> >
> > Have you considered using one of the existing python web development
> > libraries/frameworks? Like Pylons, Turbogears, Django, Spyce, Karigell,
> > etc, etc, etc, etc...
> >
> We have not considered a framework coz the legacy code base has not
> included one. We are living in the same source structure and did not
> want to introduce a newer dependency. I hope we can find a
> non-intrusive library/framework that does its job.

Hard to tell what would be more appropriate without knowledge of the
existing code base and architecture... Anyway, both Jinja and Genshi
are relatively easy to setup and get started with. Mighty is a much
more complex and powerful beast (it's almost a whole web-components
framework by itsef).
 
My 2 cents




More information about the Python-list mailing list