Python and the Internet -- not!

M.-A. Lemburg mal at lemburg.com
Tue Oct 26 04:13:17 EDT 1999


Dan Grassi wrote:
> 
> Hi,
> 
> First I have to agree that Python is the greatest language I have ever
> found.  I just wish it were a viable language for the Internet.  But no, I
> have to use PHP3 if I want to be able to write programs others can also
> install and run.
> 
> Why?  Well, PHP3 has a few things integrated that Python does not and they
> are killers.  Actually just two.
> 
> Authentication, that is the ability to get the user ID and password and
> MySQL database access is just plane impossible, no I can't rely on .htaccess
> files and mod_pyapache does not supply this as does the the PHP3 module --
> so sad.

Why should it be impossible to get the authentification data from Python ?

Could it be that you are referring to the fact that Apache does not
set those environment variables ? If yes, there is a solution used
by the Zope people (actually due to Paul Everitt, I think). Put this
into you Apache config file:

 RewriteEngine on
 RewriteCond %{HTTP:Authorization}  ^(.*)
 RewriteRule ^/(.*) /path/to/scripts/mypython.cgi/$1 [e=HTTP_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]

> The second, database access is more of a problem.  The lack of documentation
> and requirement to compile c code is not acceptable, I just can't write a
> Python program and expect even a minority of people to be able to install
> it.  Further, most will not have the required access from their IHP.  The
> several flavors of MySQL access also do not help.  The PHP3 solution was to
> make DB access a part of the language, surely this is the wave of the
> future.  Just look at a PHP3 manual, it covers exactly how to access the
> various databases.

There are lots of RPMs providing DB access for Python out there, so it's really
only a matter of OS package installation, not compilation. Building
DB access into the core would be the wrong path, since there are simply
too many different ways to communicate with DBs from within Python, e.g.
low-level DB specific APIs, ODBC, ADO, DAO, etc. pp.
 
> So its is back to PHP3, it pretty much works right out of the box on most
> IHPs even if it is not nearly as elegant as Python.  The default install
> instructions include how to install MySQL capabilities so IHPs tent to
> install it that way.

If you need an IHP with MySQL support and preconfigured Python access,
simply join the PSA and get yourself an account on starship.python.net
for free.

As for the other topics that would go under your subject line,
have a look at the chapter "11. Internet Protocols and Support"
in the Python Lib Reference. There's so much more to the Internet
than MySQL and authentication...

-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                    66 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/






More information about the Python-list mailing list