Django virtualenv deployment configuration

I recently started using virtualenvwrapper and created

mkdir ~/.virtualenvs
mkvirtualenv example.com

Virtualenvwarpper automatically creates virtualenv named example.com under ~ / .virtualenv so this is the central container for all virtualenvs. After i installed django and some other packages via pip and my site is in

 /srv/www/example.com/public_html/

Should I host my site ~ / .virtualenv / example.com if not, how can I use my example.com virtualenv with my site in /srv/www/example.com/public_html. Could you show me the apache mod_wsgi configuration for this deployment? Thanks

+5
source share
2 answers

Reading:

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

site.addsitedir(), . / , mod_wsgi, . , , WSGI script, sys.path .

+4

WSGI script:

import site
site.addsitedir('/home/username/.virtualenvs/example.com/lib/python2.5/site-packages')

(, , Python ..)

+2

All Articles