[mod_python] Newbie question: Custom module path not taken over by importer

Graham Dumpleton graham.dumpleton at gmail.com
Thu Dec 6 17:55:35 EST 2007


The mod_python module importer ignores packages as reloadable module
candidates. It also only looks on its own special module path for the
packages that are candidates for reloading. If it can't find a
module/package, it falls back to doing standard import and it looks on
sys.path for those, so it will find it in site-packages. When it falls
back to using standard import, those things aren't candidates for
reloading though. For more details see import_module() documentation
in:

  http://www.modpython.org/live/current/doc-html/pyapi-apmeth.html

Graham

On 07/12/2007, Pascal Opitz <contact at pascalopitz.com> wrote:
> Graham, thanks for your help, will give it a shot ... just for my
> understanding: Why does it work when I move the same package into the
> site-packages directory?
>
> On Dec 6, 2007 10:40 PM, Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
> > On 07/12/2007, Pascal Opitz <pascal at ilikecode.co.uk> wrote:
> > > Hi Graham,
> > >
> > > thanks for getting back.
> > > At the moment it is a folder with an __init__.py file, which has just
> > > the hello world method in there.
> > > Creating an __init__.py file should identify the folder as module, right?
> >
> > No. A directory which contains a __init__.py makes it a package.
> >
> > Maybe have a read through:
> >
> >   http://docs.python.org/tut/node8.html
> >
> > I quickly Google'd it up, but think it describes the differences.
> >
> > Please use reply-all to keep replies on the list. Thanks.
> >
> > Graham
> >
>


More information about the Mod_python mailing list