[mod_python] python path and 3.3

Clodoaldo clodoaldo.pinto.neto at gmail.com
Fri Dec 1 18:57:32 EST 2006


2006/12/1, Clodoaldo <clodoaldo.pinto.neto at gmail.com>:
> 2006/12/1, Graham Dumpleton <grahamd at dscpl.com.au>:
> >
> > >
> > > URI:            '/'
> > > Location:       None
> > > Directory:      None
> >
> > The '~/' prefix will be replaced with the value of 'Directory' as
> > shown here, but it
> > isn't set because you have the PythonHandler directive outside of any
> > Directory
> > directive or .htaccess file. Thus, it can't know what the handler
> > root is. Using:
> >
> >     DocumentRoot /var/www/html/carconsumption.com
> >     <Directory /var/www/html/carconsumption.com>
> >     SetHandler mod_python
> >     PythonHandler mod_python.publisher
> >     PythonDebug On
> >     PythonOption mod_python.importer.path "['~/mod']"
> >     </Directory>
> >
>
> Ok, I did it and now this works:
>
> import constants as C
>
> But this does not work:
>
> from mod_python import apache
> C = apache.import_module('constants.py')
>

Changed it to:

from mod_python import apache
C = apache.import_module('~/mod/constants.py')

And it works.

Thanks,
-- 
Clodoaldo Pinto Neto


More information about the Mod_python mailing list