[mod_python] package importing

Steven Lott s_lott at yahoo.com
Thu Jun 24 06:11:29 EDT 2010


You might want to post this question on StackOverflow.com.  There are many Python experts there, also.
 --
S. Lott 


Whitby 42 #188 -- "Red Ranger"




________________________________
From: Ivan Ricotti <i.ricotti at elabor.biz>
To: mod_python at modpython.org
Sent: Thu, June 24, 2010 5:43:10 AM
Subject: [mod_python] package importing

Hello,

I'm exploring mod_python and I'm having trouble with the package importing.

I've a structure like this:

<my base dir>
   |
   +- __init__.py
   +- index.py
   +- package (directory)
       |
       +- __init__.py
       +- package.py (file)

and an Apache Virtual Host like this:


<VirtualHost *:80>

        ServerAdmin root at localhost
        ServerName myname
        DocumentRoot /path/to/my base dir

        <Location />
                DirectoryIndex index.html index.py
                Options Indexes MultiViews FollowSymLinks
                AddHandler mod_python .py
                PythonHandler mod_python.publisher
        </Location>

</VirtualHost>

in the index.py file I've something like this:

    from package.package import myobject
    ....
    ....

When I load index.py from Apache, I get a 500 Internal Server Error as
follows:

    ImportError: No module named package.package

What am I doing wrong?

Cheers,
Ivan

-- 
Ivan Ricotti                
-------------------------------------------------
eLabor sc - via Giuseppe Garibaldi 33, 56127 Pisa
tel: +39 050 970 363, web: http://www.elabor.biz
email: i.ricotti at elabor.biz
GnuPG KeyID: DFD581C5 - 13/11/2003
_______________________________________________
Mod_python mailing list
Mod_python at modpython.org
http://mailman.modpython.org/mailman/listinfo/mod_python



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20100624/f28126c1/attachment.html


More information about the Mod_python mailing list