简体   繁体   中英

mod_wsgi and pylons: setting the working environment

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM