色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術(shù)文章
文章詳情頁

nginx+uwsgi部署Django遇到了麻煩

瀏覽:118日期:2024-06-26 14:48:10

問題描述

首先說明:電腦環(huán)境為Ubuntu 16.10,我使用conda管理開發(fā)環(huán)境 !!!

uwsgi使用conda install的pip安裝

uwsgi ini文件

# backend_uwsgi.ini file[uwsgi]# Django-related settings# the base directory (full path)chdir = /home/yangtz/developproject/backend# Django’s wsgi file# wsgi-file = /home/yangtz/developproject/backend/backend/wsgi.pymodule = backend.wsgi # process-related settings# mastermaster = true# maximum number of worker processesprocesses = 10# the socket (use the full path to be safesocket = /home/yangtz/developproject/backend/backend/backend.sock# ... with appropriate permissions - may be neededchmod-socket = 666# clear environment on exitvacuum = true# daemonize = /home/yangtz/developproject/backend/uwsgi.log

backend_nginx.conf

# the upstream component nginx needs to connect to upstream django {server unix:/home/yangtz/developproject/backend/backend/backend.sock; # for a file socket# server 127.0.0.1:8000; # for a web port socket (we’ll use this first) } # configuration of the server server {# the port your site will be served onlisten 80;# the domain name it will serve forserver_name 127.0.0.1; # substitute your machine’s IP address or FQDNcharset utf-8; access_log /home/yangtz/developproject/nginx_access.log;error_log /home/yangtz/developproject/nginx_error.log; # max upload sizeclient_max_body_size 75M; # adjust to taste # Django media# location /media {# alias /path/to/your/mysite/media; # your Django project’s media files - amend as required# } location /static { alias /home/yangtz/developproject/backend/static; # your Django project’s static files - amend as required} # Finally, send all non-media requests to the Django server.location / { uwsgi_pass django; include /etc/nginx/uwsgi_params; # the uwsgi_params file you installed} }

當(dāng)啟動 sudo uwsgi --ini backend_uwsgi.ini 后,結(jié)果卻是

*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** chdir() to /home/yangtz/developproject/backendyour processes number limit is 63466your memory page size is 4096 bytesdetected max file descriptor number: 1024lock engine: pthread robust mutexesthunder lock: disabled (you can enable it with --thunder-lock)uwsgi socket 0 bound to UNIX address /home/yangtz/developproject/backend/backend/backend.sock fd 3your server socket listen backlog is limited to 100 connectionsyour mercy for graceful operations on workers is 60 secondsmapped 800448 bytes (781 KB) for 10 cores*** Operational MODE: preforking ****** no app loaded. going in full dynamic mode ****** uWSGI is running in multiple interpreter mode ***!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!no request plugin is loaded, you will not be able to manage requests.you may need to install the package for your language of choice, or simply load it with --plugin.!!!!!!!!!!! END OF WARNING !!!!!!!!!!spawned uWSGI master process (pid: 9293)spawned uWSGI worker 1 (pid: 9294, cores: 1)spawned uWSGI worker 2 (pid: 9295, cores: 1)spawned uWSGI worker 3 (pid: 9296, cores: 1)spawned uWSGI worker 4 (pid: 9297, cores: 1)spawned uWSGI worker 5 (pid: 9298, cores: 1)spawned uWSGI worker 6 (pid: 9299, cores: 1)spawned uWSGI worker 7 (pid: 9300, cores: 1)spawned uWSGI worker 8 (pid: 9301, cores: 1)spawned uWSGI worker 9 (pid: 9302, cores: 1)spawned uWSGI worker 10 (pid: 9303, cores: 1)

nginx界面是

nginx+uwsgi部署Django遇到了麻煩

我看到 其中 !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!no request plugin is loaded, you will not be able to manage requests.you may need to install the package for your language of choice, or simply load it with --plugin.

于是加上 --plugin python3,得到結(jié)果卻是

Traceback (most recent call last): File './backend/wsgi.py', line 12, in <module>

from django.core.wsgi import get_wsgi_application

ImportError: No module named ’django’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

nginx界面變成

nginx+uwsgi部署Django遇到了麻煩

nginx刷新,uswgi那里有反應(yīng)。

怎么辦?求助大神解救。。。

問題解答

回答1:

sudo uwsgi

你切換了環(huán)境。你的 Django 不是安裝在系統(tǒng)全局的。

如果你使用了 virtualenv 的話,你可以在 uwsgi 的配置中指定 virtualenv 的位置。

相關(guān)文章:
主站蜘蛛池模板: 亚洲精品成人网 | 久久久久久一级毛片免费野外 | 亚洲影院在线播放 | 美女黄网站人色视频免费国产 | 国产成人在线视频免费观看 | 国产午夜精品理论片在线 | 玖玖爱zh综合伊人久久 | 精品视频一区二区三区 | 综合久久精品 | 久久视频精品线视频在线网站 | 久草新| 99在线免费观看视频 | 永久免费不卡在线观看黄网站 | 欧美成人吃奶高清视频 | 国产亚洲综合精品一区二区三区 | 不卡一区二区在线观看 | 欧美男人操女人 | 国产精品99| 亚洲国产成人久久综合碰 | 亚洲国产精品久久久久666 | 国产午夜精品久久久久免费视 | 免费特黄视频 | 国产精品国产精品国产三级普 | 亚洲欧美日韩国产精品 | 性欧美欧美之巨大69 | 成人手机看片 | 国产精品久久久久久久久久98 | 69性欧美高清影院 | 国内久久精品 | 男女男精品视频网站在线观看 | 热99re久久精品2久久久 | 亚洲一区在线播放 | 91香蕉国产在线观看免费永久 | 国产精品亚洲四区在线观看 | 国产一区二区免费不卡在线播放 | 日韩国产成人精品视频 | 国产高清日韩 | 玖玖玖视频在线观看视频6 玖玖影院在线观看 | 久久久综合久久 | 欧美xo影院 | 亚洲欧美日本综合一区二区三区 |