2

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 locally with "python web2py.py" command.

Any suggestion?

ndemir
  • 1,881
  • 3
  • 19
  • 25

3 Answers3

1

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.

Anthony
  • 25,466
  • 3
  • 28
  • 57
1

I will answer my own question :) I started using mod_proxy and everything is ok.

ndemir
  • 1,881
  • 3
  • 19
  • 25
0

Add testapp to your PYTHONPATH.

Louis
  • 2,854
  • 2
  • 19
  • 24