Separation of content and code for web (was Re: Python for web ?)

Peter Hansen peter at engcorp.com
Mon Dec 1 13:15:17 EST 2003


Robert Brewer wrote:
> 
> Jay O'Connor wrote:
> > Same here.  I do the backend programming and usually give the
> > designer a
> > page (See these marks?  Don't touch them, the rest of the page is
> > yours)  Works well because I'm *not* a graphices designer and
> > I get much
> > better results when I make it work and I give it to a friend
> > to make it look good.
> 
> Heh. I'm trying to move into the opposite situation: I do the design and
> give a backend programmer a page (See these marks? Touch them and them
> only; the rest of the page is mine). Works well because the design is
> not then driven by someone who's not a designer. :)

By far the most rigorous separation that I've seen to date, and one
we're experimenting with more right now, is to have a pure-HTML (or XHTML)
web page with *no* code or funky little embedded crap of any kind at
all, and rely exclusively on "id" attributes on the dynamic parts.

The code is built to work on the appropriate ids, generally working with
an in-memory model of the data, with serialization back to [X]HTML 
when the job is done.

Web folks get their HTML page without code, programmers get nice 
code without embedded HMTL, and everyone is happy.

I think there's a Java system where this idea was implemented best
but the name doesn't come to mind at the moment.

Anyone know of a Python-based approach using the same core concept?

-Peter




More information about the Python-list mailing list