You can activate the virtualenv in the WSGI script itself, see the slides from PyCon 2010 <https://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-pycon-sydney-2010.pdf>. Don't know what the problem with WSGIPythonHome is, sorry.
On 03.04.2011 10:27, Tim Valenta wrote: > Hello, > > I'm trying to leverage a python virtualenv to set up what happens to > be a Django project. To get things started, the virtualenv has just > the basics: SVN checkout of Django trunk, pip, and the MySQLdb-python > package. > > It's my understanding that the use of the global WSGIPythonHome > directive should allow me to specify the path into my virtualenv (it's > sys.prefix value) and mod_wsgi would use that version of python > (assuming it matches the major/minor version as it was compiled > against). > > I've been pouring over documentation to figure out what I might be > missing, but use of the directive doesn't seem to have much effect; > Apache comes up with a 500 error where the log states that it cannot > find the "django" module. If I hack my project's .wsgi file to append > django to the path, then the Apache error log reports that MySQLdb > cannot be found. > > Both modules import without problem when I use my virtualenv python, > and of course both fail when I use the system default python. > > Thinking to explore the problem further, I tried specifying in > addition the WSGIPythonPath directive, to point mod_wsgi at the > virtualenv's site-packages, but the situation is unchanged. > > I'm wondering if there is any extra trouble I'm going through by using > a VirtualHost? Here is the extracted bit from my virtualhost > configuration, which is included via sites-enabled: > > WSGIPythonHome /home/tim/project/myenv > <VirtualHost *:80> > WSGIScriptAlias / /home/tim/project/project.wsgi > ... > </VirtualHost> > > Any suggestions as to what I might be doing wrong to make mod_wsgi not > actually make the leap to my virtualenv python? Or maybe I'm making > assumptions about what this directive can do... > > Thanks in advance. > -- 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.
