local_import function randomly does not import my modules from modules directory. The Error is:
ImportError: No module named testapp.modules.mymodule
I have this problem when i use web2py with apache (with wsgi). I have no problem when i run l开发者_JAVA百科ocally with "python web2py.py" command.
Any suggestion?
As of version 1.96.1, local_import()
has been deprecated. You should be able to do:
import mymodule
and it will look in your application's /modules folder before checking sys.path.
I will answer my own question :) I started using mod_proxy and everything is ok.
Add testapp
to your PYTHONPATH
.
精彩评论