[mod_python] PLEASE guide

Graham Dumpleton graham.dumpleton at gmail.com
Mon Dec 10 04:42:15 EST 2007


There is no mod_python 2.2. The latest and best version to use is 3.3.1.

Start out with a hello world program by following:

  http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking

This uses a basic mod_python handler, but will at least ensure you
have Apache configured properly to run mod_python.

Since you appear to want to use mod_python.publisher, then  perhaps
work through:

  http://webpython.codepoint.net/mod_python

Graham

On 10/12/2007, nitin chandra <nitinchandra1 at gmail.com> wrote:
> Hello Everyone,
>
>
> I wrote this script below, it is installed in '/var/www/html/lr' directory.
> Installed are Apache 2, mod_python2.2, and postgreSQL8.2 and python 2.4
>
>
> =X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X
>
> from mod_python import apache
> import psycopg2
>
> template = """<html>
> <head><title>Candidates' Details Entered</title></head>
> <body bgcolor="#87CEFA">
> <H1 ALIGN="CENTER"/><U/>Candidates' Details Entered</U/></H1/>
> <table align=left border=2 cellpadding=6>
> %s
> </table>
> </body>
> </head>"""
>
> def query(req, query, rows=[]):
>     conn = psycopg2.connect('user=nitin dbname=nitin')
>     curs = conn.cursor()
>     curs.execute( 'SELECT * FROM area' ) ## Running this line from
> command prompt, it works.
>     rows = curs.fetchall()
>
>     req.content_type='text/html'
>
>     outp= ""
>     outp += '<tr><td>First Name Entered:&nbsp %s</td></tr>' %(rows)
>
>     req.write(template % outp)
>     return apache.OK
>
> =X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=
>
> Running the application from Apache i get the following error.
>
> "NOT FOUND"
> "The requested URL /test/testlr.py was not found on this server."
> "Apache/2.0.52 (MostlyLinux) Server at localhost Port 80"
>
>
> Please guide.
>
> TIA.
> Nitin
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list