Database with a web-interface (CGI)

Boudewijn Rempt boud at rempt.xs4all.nl
Tue Feb 8 09:40:30 EST 2000


Peter Bittner <bittneph at aston.ac.uk> wrote:
> Hi there!

> I need to build a web-interface with a database in the background
> (probably Oracle; possibly MySQL), so I need to write a Python
> CGI-script that takes input from an HTML-form and puts the data into the
> database (Input-operation) and, repectively, gets data out of the
> database with an SQL-query and displays the result in the browser.

> I've looked for example-source, but there doesn't seem to be much in the
> Web on Python (unlike Perl & PHP).  :o(

> Does anyone have some example source?

I've already sent you the stuff separately, but for the benefit of the
common weal: on my website (http://www.valdyas.org/python) you can find
a small cgi application that uses MySQLmodule (nowadays I would use
MySQLdb, but it's an old app). I also think my approach to generating
html is wrong, but it does work. I'd work with templates and %(name)s
substitution, nowadays, but when I wrote this I came fresh from Pascal,
Visual Basic and PL/SQL, and I didn't know any better.

-- 

Boudewijn Rempt  | http://www.valdyas.org



More information about the Python-list mailing list