If you module is a file
applications/mypp/modules/mymodule.py
then you should be able to import is with
from applications.myapp.modules.mymodule import *
or
exec('from applications.%s.modules.mymodule import *' %
request.application)
It is important that the module itself imports other files from the
same module using relative paths and not absolute paths.
Massimo
On Oct 16, 5:37 am, leone <[email protected]> wrote:
> I try to import a module of py files (initialized by __init__.py) and
> that is set in applications/myapp/modules folder, but I receive errors
> about import.
>
> from applications/myapp/modules/mymodule import * fails!
>
> Is it possible this approach or I have to put py files directly under /
> modules directory?
> If not, why?
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---