Setting up Apache and Python WSGI to use VirtualEnv

前端 未结 1 918
情话喂你
情话喂你 2020-12-09 06:55

I\'m having trouble getting Apache/WSGI to use my VirtualEnv. I have added the following two lines (path on server is pointing to the actual location of site-packages in th

相关标签:
1条回答
  • 2020-12-09 07:36

    In my app.wsgi file I have something like this. You will need to change it to put to where your virtual env is located, mine is under /opt/ve/ve_name/ in this example.

    import os
    # activate virtualenv
    activate_this = os.path.expanduser("/opt/ve/ve_name/bin/activate_this.py")
    execfile(activate_this, dict(__file__=activate_this))
    
    0 讨论(0)
提交回复
热议问题