[mod_python] Need Help ...Please!!!

nitin chandra nitinchandra1 at gmail.com
Thu Mar 29 06:54:38 EST 2007

Hi Everyone!

I need some help here.

I have a WinXP laptop, installed with Python2.4, Apache 2.0.59,
psycopg2-, PostgreSQL 8.2.

Now i have created a DB as "nitin" and a user "nitin", further i
created 13 more tables within the DB. One of the
tables is named as "area". This, "area", table has 11 fields. Two
fields are left blank as they will
be entered through a web interface.

So i am trying to read the complete row and display the existing data
in the table. The display of the data is to be done in various forms
fields over the Web-interface / html(or CSS). Lastly, Enter data in
blank form fields and update the table.

I am writing a 'area.py' script for the above.


from mod_python import apache
import sys, psycopg

conn = psycopg.connect("dbname=nitin user=nitin passwd=" "")

curs = conn.cursor()

<head><title>Owners' Details Entered</title></head>
<body bgcolor="#87CEFA">
<table align=center border=2 cellpadding=6>

curs.execute("SELECT * FROM area")
rows = curs.fetchall()

print <tr><td>rows</td></tr>



And it does not work. When I load the page in IE, HTML works but the
rest of the code is displayed as it is,i.e. as text.

Are there any samples available on the net where i can look at.

Please guide.


More information about the Mod_python mailing list