Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you mind sharing your django.wsgi file? I'm trying to set this up right now for a site I'm working on. After looking throught the docs and some blog posts it wasn't clear to me how to hook up apache and virtualenv. Do you source in the env via the activate script? I feel like I'm missing something. Thanks.


Basically in the WSGI file (which is just python code) you need to insert the virtual-env site packages in sys.path, with something like this ...

  virtenvdir = '/path/to/virtual-env/lib/python2.5/site-packages/'

  import sys
  if virtenvdir not in sys.path:
      sys.path.insert(0, virtenvdir)





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: