[Featureserver] Can't adapt error
Yves Moisan
yves.moisan at boreal-is.com
Thu Aug 27 12:20:00 EDT 2009
Le jeudi 27 août 2009 à 11:09 -0400, Yves Moisan a écrit :
> >
> > import psycopg2
> > import psycopg2.extras
> > import psycopg2.extensions
> > import mod_python
> > psycopg2.extensions.register_adapter(mod_python.util.StringField, \
> > psycopg2.extensions.QuotedString)
> >
> > I tried plunking that into PostGIS.py to no avail.
>
> Plunking those lines in handlers.py does the trick. FS now works
> properly under mod_python. However, it won't run in CGI mode anymore.
> Apache error.log says "ImportError: No module named _apache\r" which is
> the same as if you try the above commands one by one at the Python
> prompt. It will stumble at the "import mod_python" line and spew out
> that same error.
>
> Can the handler detect a mod_python environment and activate those lines
> only then ?
OK. Got it working decently now by modifying only the mod_python
function in handlers.py. Both mod_python and CGI work. Patch attached.
Yves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: handlers.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/featureserver/attachments/20090827/2d32d6bd/handlers.bin
More information about the Featureserver
mailing list