Web development with Python 3.1
robillard.etienne at gmail.com
Sat Oct 31 00:16:55 CET 2009
On Oct 30, 7:01 pm, erob <robillard.etie... at gmail.com> wrote:
> On Oct 28, 5:16 am, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> > Dotan Cohen schrieb:
> > >> While I know that to be true in the general sense, from what I've
> > >> looked at Django and other frameworks it seems that the web frameworks
> > >> push the coder to use templates, not letting him near the HTML.
> > >> For instance, I was looking for a class / framework that provided a
> > >> proven method of decoding cookies (setting them is no problem),
> > >> decoding POST and GET variables, escaping variables for safe entry
> > >> into MySQL, and other things. Django and the other frameworks seem to
> > >> force the user to use templates. I just want the functions, and to
> > >> print the HTML as stdout to the browser making the request. I had to
> > >> settle on PHP to do this, which admittedly is what PHP was invented to
> > >> do. However, for obvious reasons, I would have prefered to code in
> > >> Python. In fact, I still would.
> > > I should probably expand on this:
> > > How can I get an array with all the GET variables in Python?
> > > How can I get an array with all the POST variables in Python?
> > > How can I get an array with all the COOKIE variables in Python?
> > > How can I get the request URI path (everything after
> > >http://[www.?]example.com/)?
> > > That's all I want: no templates and nothing between me and the HTML.
> > > The HTTP headers I can output to stdout myself as well.
> > Again: if you insist on doing everything yourself - then of course any
> > library or framework isn't for you.
> > But then do you deal with headers correctly? Do you respect character
> > encodings? Form-encodings? Is your generated HTML valid? Are
> > timestamp-formats generated according to RFCs for your cookies? Do you
> > parse content negotiation headers?
> > I think you underestimate the task it is to make a webapplication good.
> > And even if not, what you will do is ... code your own webframework.
> > Because there is a lot of boilerplate otherwis. If that's a
> > learning-experience your after, fine.
> > Besides, yes, you can get all these things nonetheless. You just don't
> > need them most of the time.
> > And at least pylons/TG2 lets you return whatever you want instead, as a
> > string. Not via "print" though - which is simply only for CGI, and no
> > other means (e.g. mod_wsgi) of python-web-programming.
> > Diez
> notmm uses Python 2.6 and will probably work just fine with Python
> P.S - We all don't think in the same box.
"I am free, no matter what rules surround me. If I find them
tolerable, I tolerate them; if I find them too obnoxious, I break
them. I am free because I know that I alone am morally responsible for
everything I do." -- Robert A. Heinlein
More information about the Python-list