[Python-Dev] Web Programming Improvements
Andrew Kuchling
akuchlin@mems-exchange.org
Thu, 2 Nov 2000 17:12:26 -0500
On Thu, Nov 02, 2000 at 05:06:16AM -0500, Guido van Rossum wrote:
>I just skimmed PEP 222. I agree that the classes defined by cgi.py
>are unnecessarily arcane. I wonder if it isn't better to just start
>over rather than trying to add yet another new class to the already
>top-heavy CGI module???
I've wondered about that, too; writing a neat request class that wraps
up field values, cookies, and environment variables, and provides
convenience functions for re-creating the current URL, Something like
the request classes in Zope and Webware.
>Regarding file uploads: you *seem* to be proposing that uploaded files
>should be loaded into memory only. I've got complaints from people
Mrr...? The only file upload reference simply says you shouldn't have
to subclass in order to use them; it's not implying files have to be
read into memory. (We have to deal with whackingly large mask layout
files at work, after all.)
>Regarding templating -- what's wrong with HTMLgen as a starting point?
>Just that it's too big? I've never used it myself, but I've always
>been impressed with its appearance. :-)
I, personally, am against including templating, but it was suggested.
I'm against it because there are too many solutions with different
tradeoffs. Do you want a simple regex search-and-replace,
constructing HTML pages as Python objects, or a full-blown
minilanguage? HTML/XML-compatibile syntax, ASP-compatible syntax,
Python-compatible syntax? Much better just to move templating into
the "Rejected" category and give the above rationale.
--amk