views:

87

answers:

1

I'm trying to setup Pylons (1.0) with Apache mod_wsgi. Everything works fine with mod_wsgi and I can run a simple python wsgi app just fine.

I've got the quickwiki example from the Pylons site working when running it with paster, but obviously I would never deploy in such a manner - so I'm trying to get the Quickwiki example working with mod_wsgi. When I use paster to run the site, I have to source ./pylons/bin/activate and I feel like this is the "step" that is missing when trying to get it working with mod_wsgi. The ./pylons/bin/activate script is the one that was in the source when downloading pylons.

When using it with mod_wsgi, I get:

ImportError: No module named paste.deploy

I've looked at this site but just appending the path of the pylons app doesn't do it.

I've also looked at this site, but it didn't seem to do anything significant (and didn't solve the issue) when issuing:

import activate_workingenv
activate_workingenv.activate_workingenv(WORKING_ENV)

Looking at the sys.path after issuing source ./pylons/bin/activate shows like a dozen things added to the path, including the paster stuff and all my requirements. I'd rather not hardcode all those in the script - what am I missing here?

I'm new to Pylons and my Python skills aren't super strong, so I may be missing something really simple.

+3  A: 

Read:

http://code.google.com/p/modwsgi/wiki/VirtualEnvironments

Graham Dumpleton
Much thanks. It works. I'd actually looked at that a few times but couldn't tell if thats what I should be using. This line was the kicker: site.addsitedir('/usr/local/pythonenv/PYLONS-1/lib/python2.5/site-packages')
rfusca