开发者

local_import function does not work

开发者 https://www.devze.com 2023-04-08 09:30 出处:网络
local_import function randomly does not import my modules from modules directory. The Error is: ImportError: No module named testapp.modules.mymodule

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号