Web development with Python 3.1
Dotan Cohen
dotancohen at gmail.com
Thu Oct 29 04:51:48 EDT 2009
>> As is, in my case. Actually, what use case is there for having Apache
>> reprocess the HTML output of the script?
>
> compression, cache, whatever...
>
Thanks. I actually did think of compression.
>>> It's not that it was unclear, but that it's innaccurate. "outputting to
>>> stdout" is an implementation detail, and should not be exposed at the
>>> applicative code level. Dealing with appropriate abstraction - here, an
>>> HttpResponse object - is far better (well, IMHO of course... - standard
>>> disclaimers, YMMV etc).
>>>
>>
>> I see. I believe that is called Dotan's Razor: a slight inaccuracy
>> saves a lengthy explanation.
>
> but also impacts your "mental map" of what's going on... You're thinking in
> terms of streams and stdout, which, while not that far from actual
> implementation (in the end it always boils down to bits sent over the
> wires...), might not be the right level of abstraction when it comes to
> application programming.
>
Seeing how the templating engines work, I now know why my choice of
words bothered you. In fact, I was thinking in terms of PHP's linear
progress through the code which is not quite valid here. Thank you for
taking the time to set me straight.
> What I saw is already complex enough to justify using better tools IMHO. Or
> to make better use of the one you have.
>
I am beginning to see how true that is.
> I'd personnaly suggest either Mako (possibly one of the best Python
> templating systems) or Django's (well documented and beginner-friendly).
>
I will examine them both this weekend. Thanks!
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
More information about the Python-list
mailing list