[英]WSGI/Nginx/Internal server error arises when I deactivate virtual environment (no python application found)
I'm stuck with this error. 我陷入了这个错误。 -— no python application found, check your startup logs for errors —- Internal server error.
--未找到python应用程序,请检查启动日志中是否有错误-内部服务器错误。
Whenever I'm in virtual environment all works fine but If I deactivate virtualenv I'm constantly getting this error each time when I send a GET query to my webpage. 每当我在虚拟环境中时,一切都可以正常工作,但是如果我停用virtualenv,则每次向我的网页发送GET查询时,我都会不断收到此错误。 So because of this problem Im getting this error in supervisor mode.
因此由于这个问题,我在主管模式下遇到此错误。
I have tested this outside of supervisor mode using this command: uwsgi —ini my_site_uwsgi.ini And like I said before It works fine when I'm in virtualenv and It raises error listed above error when I deactivate virtualenv. 我已经使用以下命令在超级用户模式之外对此进行了测试:uwsgi —ini my_site_uwsgi.ini就像我之前说的那样,当我处于virtualenv时工作正常,并且在禁用virtualenv时出现上面列出的错误。
#codepaint_news_uwsgi.ini
[uwsgi]
chdir = /home/django/codepaint
module = codepaint.wsgi
home = /home/django/venv
master = true
processes = 10
socket = /home/django/codepaint/uwsgi_nginx.sock
chmod-socket = 666
vacuum = true
env = DEBUG_MODE=False
_____________________________________
#wsgi.py
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "codepaint.settings")
application = get_wsgi_application()
______________________________________
Internal server error. 内部服务器错误。 -— no python application found, check your startup logs for errors —-
--未找到python应用程序,请检查您的启动日志中的错误-
将venv中已安装的应用程序与非venv中的已安装应用程序(全局python)进行比较。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.