[mod_python] psp import problem

Graham Dumpleton graham.dumpleton at gmail.com
Fri Jun 8 18:21:14 EDT 2007


Problem described here:

  https://issues.apache.org/jira/browse/MODPYTHON-220

Where you have:

  import xyz

try replacing it with:

  from mod_python import apache
  xyz = apache.import_module("~/xyz.py")

Tell us if this work around fixes problem.

Graham

On 08/06/07, Alex Greif <alex.greif at gmail.com> wrote:
> Hi,
>
> I use version 4 of the document
> (http://www.modpython.org/pipermail/mod_python/2006-November/022726.html)
> to store my mod_python sources.
> If I put consts.py in the lib folder (which is on the same level as the
> handlers), then I can import consts from the handlers, but not from the psp
> files.
>
> What is the prefered way to import custom python sources in psp files?
>
> In my apache conf I have the following:
>
>     SetHandler mod_python
>     PythonHandler mod_python.publisher
>     PythonDebug On
>     PythonOption mod_python.importer.path "['~/lib']"
>
>
> I am using MP 3.3.1 with apache 2.2.4 on Mac Os X 10.4.9
>
>
>
>
> Alex.
>
> --
> alex.greif at gmail.com
>
>
>
>
> _______________________________________________
> 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