On Dec 16, 2:49 pm, clinch <[EMAIL PROTECTED]> wrote: > I just figured it out. I was trying to run web.py by copying the "web" > directory to the same directory as hello.py, however this caused the > problems you see above. After running "python setup.py install" > everything seems to be working fine.
The directory the script is in is not added to sys.path and it is recommended that you don't go adding it either. This is done for technical reasons related to how mod_wsgi loads modules, but also to encourage people not to be putting Python application source code, except for the script file itself, in the Apache document directories. The script file itself, unless very simple, should really just be a very thin wrapper which actually imports all its code from directories outside of the document tree. This is recommended to make it somewhat harder to accidentally expose your source code through incorrect configuration of Apache. Thus, other code should be installed in site-packages, or a directory which the script file explicitly adds to sys.path or which has been listed using the WSGIPythonPath directive or python-path option to WSGIDaemonProcess directive. Which of the latter is used depends on which version of mod_wsgi is being used and which mode. For a bit about those technical reasons related to reloading, and comments about setting sys.path, see section "Module Reloading Mechanism" of: http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode For details about setting module search path from configuration, see WSGIPythonPath and WSGIDaemonProcess directives in: http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" 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/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
