In my db.py I want to import a module called for example test_module.py and
located in applications/application_name/modules like following:
from test_module import *
this was not working on my Web2py installation, while it was working on
another installation. It seems web2py is not looking inside the folder
applications/application_name/modules at all
Both installation have the following parameters:
Web2py: Version 2.4.6-stable+timestamp.2013.04.06.17.37.38
Python: 2.7.1 (r271:86832, Nov 27 2010, 18:30:46)
The only difference between the two installtions is the not working one is
on 32bits Wondows while the working one is 64bits Windows
I did a workaround to force Web2py to look inside the folder
applications/application_name/modules :
import sys
import os
path = os.path.join(request.env.web2py_path , 'applications',
request.application , 'modules')
if not path in sys.path:
sys.path.append(path)
from test_module import *
Is that a bug in Web2py? or Python? Does anybody have an explanation for
that?
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.