uWSGI + virtualenv 'No module named site'

前端 未结 3 1181
一个人的身影
一个人的身影 2021-02-13 12:04

So this seems to be a really common problem with this setup, but I can\'t find any solutions that work on SO. I\'ve setup a very new Ubuntu 15.04 server, then installed nginx, v

3条回答
  •  别那么骄傲
    2021-02-13 12:38

    The site module is in the root of django.

    First check is to activate the virtualenv manually (source /root/Env/example/bin/activate, start python and import site). If that fails, pip install django.

    Assuming that django is correctly installed in the virtualenv, make sure that uWSGI activates the virtualenv. Relevant uWSGI configuration directives:

    plugins = python
    virtualenv = /root/Env/example
    

    and in case you have error importing example.wsgi:

    pythonpath = /srv/www/example/app/example
    

提交回复
热议问题