Where should WSGIPythonPath point in my virtualenv?

后端 未结 3 906
小蘑菇
小蘑菇 2020-12-30 01:02

I have a folder called python2.7 inside of lib in the virtual environment.

After reading half a dozen tutorials, I can\'t figure out exactl

3条回答
  •  無奈伤痛
    2020-12-30 01:36

    Here is the official documentation: https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/#using-a-virtualenv

    Using a virtualenv¶

    If you install your project’s Python dependencies inside a virtualenv, you’ll need to add the path to this virtualenv’s site-packages directory to your Python path as well. To do this, add an additional path to your WSGIPythonPath directive, with multiple paths separated by a colon (:) if using a UNIX-like system, or a semicolon (;) if using Windows. If any part of a directory path contains a space character, the complete argument string to WSGIPythonPath must be quoted:

    > WSGIPythonPath
    > /path/to/mysite.com:/path/to/your/venv/lib/python3.X/site-packages
    

    Make sure you give the correct path to your virtualenv, and replace python3.X with the correct Python version (e.g. python3.4).

提交回复
热议问题