简体   繁体   中英

site.addsitedir not fully processing .pth file

This is a apache/mod_wsgi/virtualenv/django stack. In the virtualenv site-packages dir I've got a virtualenv_path_extensions.pth file. The apache conf has a

WSGIScriptAlias / /path/to/my.wsgi

my.wsgi has

site.addsitedir('/path/to/virtualenv/site-packages')

Now, if I start up a python shell, import site, and call the line above, my sys.path looks correct : it has loaded all the paths in the virtualenv_path_extensions.pth

However, Under apache I'm getting 500 errors because it claims django is not on the path. When I log sys.path after the addsitedir line in my.wsgi, it looks as if it has added the first line of virtualenv_path_extensions.pth, but not the rest!

What might cause that?

Ah, selinux :D

The paths that were not getting loaded had the wrong context, and apache wasn't able to touch them ...

** must remember to check those selinux logs when mysteries arise **

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