简体   繁体   English

导入错误:没有用于 wsgi 服务器设置的名为 django.core.wsgi 的模块

[英]ImportError: No module named django.core.wsgi for wsgi server setting

I am setting with djano and uwsgi我正在设置 djano 和 uwsgi

$uwsgi --ini uwsgi.ini

My Django root is here /var/www/html/myapp/current我的 Django 根在这里/var/www/html/myapp/current

It must be quite simple setting however I am not sure the yet.它必须是非常简单的设置,但我还不确定。

I have these two files我有这两个文件

/var/www/html/myapp/current/myapp/settings.py /var/www/html/myapp/current/myapp/wsgi.py /var/www/html/myapp/current/myapp/settings.py /var/www/html/myapp/current/myapp/wsgi.py

[uwsgi]
chdir=/var/www/html/myapp/current #it success
module=myapp.wsgi:application #it success
env DJANGO_SETTINGS_MODULE=myapp.settings # it success
http-socket = 0.0.0.0:8008
processes = 1
threasds = 1
master = 1
max-requests = 100000

The error is below, but I can't dig the detailed logs.错误如下,但我无法挖掘详细的日志。

spawned uWSGI worker 1 (pid: 27353, cores: 1)
--- no python application found, check your startup logs for errors ---
[pid: 27353|app: -1|req: -1/1] 172.17.1.143 () {28 vars in 334 bytes} [Thu Mar 26 17:37:01 2020] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

And this error occurs.并且发生此错误。

*** Operational MODE: single process ***
Traceback (most recent call last):
  File "./myapp/wsgi.py", line 13, in <module>
    from django.core.wsgi import get_wsgi_application
ImportError: No module named django.core.wsgi
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1705)
spawned uWSGI worker 1 (pid: 1706, cores: 1)
spawned uWSGI http 1 (pid: 1707)

error happens here错误发生在这里

from django.core.wsgi import get_wsgi_application

Also I am using anaconda3我也在使用anaconda3

$conda activate py37 then $conda activate py37然后

start this command启动这个命令

$uwsgi --ini uwsgi.ini

I solved the problem , the problem was uwsgi itself.我解决了这个问题,问题是 uwsgi 本身。

My setting file was ok.我的设置文件没问题。

install uwsgi by conda通过conda安装conda

conda install -c conda-forge libiconv

conda install -c conda-forge uwsgi

then start uwsgi /home/ubuntu/anaconda3/envs/py37/bin/uwsgi --ini uwsgi.ini然后启动uwsgi /home/ubuntu/anaconda3/envs/py37/bin/uwsgi --ini uwsgi.ini

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ImportError:没有名为django.core.wsgi的模块 - ImportError: No module named django.core.wsgi ImportError:使用nginx部署时,没有名为django.core.wsgi的模块 - ImportError: No module named django.core.wsgi when deploying with nginx Apache Django应用程序:ImportError:没有名为django.core.wsgi的模块 - Apache Django app: ImportError: No module named django.core.wsgi Django-ImportError:没有名为django.core.wsgi的模块 - Django - ImportError : no module named django.core.wsgi App Engine + Django:ImportError:没有名为django.core.wsgi的模块 - App Engine + Django: ImportError: No module named django.core.wsgi “ ImportError:没有名为django.core.wsgi的模块” apache错误 - “ImportError: No module named django.core.wsgi” apache error ImportError:Elastic Beanstalk中没有名为django.core.wsgi的模块 - ImportError: No module named django.core.wsgi in Elastic Beanstalk 导入错误:没有名为 django.core.wsgi 的模块(ubuntu) - ImportError: No module named django.core.wsgi (ubuntu) ImportError:uwsgi没有名为django.core.wsgi的模块 - ImportError: No module named django.core.wsgi for uwsgi Django网站上的500服务器错误-ImportError:没有名为django.core.wsgi的模块 - 500 Server Error on Django Website - ImportError: No module named django.core.wsgi
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM