简体   繁体   English

停用虚拟环境时,出现WSGI / Nginx /内部服务器错误(未找到python应用程序)

[英]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.

相关问题 我无法在 python 中停用虚拟环境 - I can't deactivate virtual environment in python 在wsgi中导入python模块时500内部服务器错误 - 500 internal server error when importing a python module in wsgi python + nginx内部服务器错误 - python + nginx internal server error Heroku 内部服务器错误(未找到 python 应用程序)flask - Heroku Internal Server Error (no python application found) flask WSGI脚本无法作为Python模块加载— 500内部服务器错误 - WSGI Script Cannot Be Loaded as Python Module — 500 Internal Server Error Python WSGI + Flask render_template-500内部服务器错误? - Python WSGI + Flask render_template - 500 Internal Server Error? Django wsgi.py设置导致内部服务器错误而不记录日志的电子邮件环境变量 - Django wsgi.py Setting Email Environment Variables Causing Internal Server Error No Logging Python 虚拟环境错误:flask 和 spacy 库的模块未找到错误 - Python virtual environment error: Module not found error for flask and spacy libraries 带有wsgi的Django + Apache收到“内部服务器错误” - Django + Apache with wsgi got “Internal Server Error” 无法从虚拟环境中退出 python django。(尝试停用,停用源并退出无效) - Not able to exit from virtual environment python django.(Tried Deactivate,source deactivate and exit nothing worked)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM