On 20 January 2011 22:59, <[email protected]> wrote: > Ability to use virtualenvs easily. I installed trac to virtualenv and had to > bang my head against wall for quite some time. The only way I was able to > get it work was to manually include all eggs and paths from virtualenv in > the sys.path in the wsgi file (WSGIScriptAlias) ... > > Not cool, and every time I install something in the virtualenv I need to go > back and tweak the list.
Likely because you were using sys.path.(insert|append)() and not site.addsitedir(). Only the latter processes .pth files which a lot of stuff is using these days. Even with site.addsitedir(), it doesn't do path reordering to ensure that virtual environment versions override system wide site-packages variants. If you use WSGIPythonPath for embedded mode or python-path option to WSGIDaemonProcess for daemon mode, it will do the reordering to ensure things work. As Dan pointed out read: http://code.google.com/p/modwsgi/wiki/VirtualEnvironments for more information about these options as well as how to do reordering yourself if you want everything to be in the WSGI script file. You can also just use the virtualenv suggested mechanism of: activate_this = '/path/to/env/bin/activate_this.py' execfile(activate_this, dict(__file__=activate_this)) My resistance to that method has waned even though don't like that it changes sys.prefix, but haven't updated the documentation. Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" 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/modwsgi?hl=en.
