Python web development, really

Afanasiy abelikov72 at hotmail.com
Tue Jan 21 07:26:02 EST 2003


On 21 Jan 2003 03:34:28 -0800, paul at boddie.net (Paul Boddie) wrote:

>> * Provide a fairly equivalent framework w/ sessions, cookies, get, post
>>   (Described in http://www.boddie.org.uk/python/web_frameworks.html)
>>   (eg. I should not have to write code to parse query strings, etc.)
>>   (PHP is somewhat unique in the ways it can bring in post variables)
>
>I'm not familiar with PHP, but with most Python frameworks you don't
>need to parse the raw HTTP inputs, and with many frameworks you have
>convenient interfaces to those inputs. Webware provides a servlet-like
>interface, although it's much more "sane" than the Java Servlet API
>(in case you were wondering).
>
>As for the "unique" aspects of PHP's variable handling, are you
>referring to something like this...?
>
>  http://www.php.net/manual/en/security.registerglobals.php

I am referring to things like PHP automatically splitting multi-valued
form fields (checkboxes, select/option) into arrays for you if you just
name them, in the html, with [] appended. Just a thoughtful addition.

Or perhaps Python developers consider it another horrible implicit.

>> * Allow sending of raw binary data, for restricted file downloading
>>   (eg. http://example.com/sendfile.php?id=A6DE12FAB3...etc)
>>   (This requires header manipulation, specifically the mime type)
>>   (That sort of thing should be part of the framework 3 bullets up)
>
>You mean full control over headers and the ability to bypass the
>templating system?

To clarify, this requirement means I need to be able to explicitly replace
the request result such that it is in effect returning a binary file for
download. This is often used for secure downloading of protected files.

This requirement implies some method for customizing request result
headers, specifically Content-type/disposition/transfer-encoding/etc.
A good platform will simply allow customization of all headers.
(Header modification, as mentioned, is part of the framework requirement)

Additionally, some platforms might have a problem with including the
binary file as the actual result of the request (after the headers).

>> * Allow SSL secured authorize.net credit card processing
>>   (I currently use PHP's libcurl+ssl module)
>
>This is presumably where your application connects out to another
>application - some kind of back-end integration. This should be
>possible, yes, but I'm not aware of any components for it that just
>plug into a Python framework or application server, although there
>could be a product available for Zope. Meanwhile, various Webware
>people may have experience with this kind of thing even though the
>Webware framework doesn't have a "checkbox feature" entitled "credit
>card processing".

You need to be able to automate a post from https to https (with the
ability to fake referer) and parse the result of your request.

I've done half of this with Python scripts already for an entirely
different end-effect, but never using SSL and never faking HTTP_REFERER.

>> * Big plus, but optional, auto prepend/append files
>>   (eg. Apache+PHP has .htaccess directives like this )
>>   (    php_value auto_prepend_file "_header.php"     )
>>   (    php_value auto_append_file "_footer.php"      )
>>   (granular down to the directory 
>
>That's an Apache thing, surely, so you might want to check to see
>whether various frameworks and templating systems are open to such
>external content manipulation - ie. that they generate page fragments
>rather than full pages. I would guess that most systems are.

It's a mod_php thing. PHP, and mod_python, are optionally configurable
in Apache's rather flexible configuration system; allowing per directory
granularity if desired, and cascading/inheritance to subdirectories.
( Of course, there are a couple other ways to configure,
  and security for the different methods and directives  )

Anyway, the ability to implicitly include was the requirement.
I gave an example of how it is done in PHP for reference.

Thanks for the info, I will check out the Wiki.
So far, additional platforms I have found are strangely non-elegant.




More information about the Python-list mailing list