2 shishi1234 shishi1234 于 2016.04.14 19:17 提问

django + uwsgi + nginx 报错,求助

django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
unable to load app 0 (mountpoint='') (callable not found or import error)
--- no python application found, check your startup logs for errors ---
[pid: 26804|app: -1|req: -1/2] 192.168.54.190 () {46 vars in 800 bytes} [Thu Apr 14 19:14:48 2016] GET /favicon.ico => generated 21 bytes in 1 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)

一直报这个错误。

请问,如何解决。

nginx配置如下:

        include uwsgi_params;
        uwsgi_pass 127.0.0.1:8003;

uwsgi_param UWSGI_MODULE manage;

uwsgi_param UWSGI_SCRIPT urls.py;

uwsgi配置如下:
[uwsgi]

socket = 127.0.0.1:8003
plugins = python
master = true
vhost = false
#wsgi-file = /data/www/spider/web/www/www/wsgi.pv
socket=127.0.0.1:8003
workers = 1
chdir=/web/www/www
post-buffering=4096
#Edaemonize=/tmp/aaa.log
#module=django.core.handlers.wsgi.WSGIHandler
debug=true

2个回答

CSDNXIAOS
CSDNXIAOS   2016.04.14 19:22

基于nginx + uwsgi 的django部署
一、环境搭建:
1、sudo apt-get install nginx
2、sudo pip install uwsgi
debian/buntu 系统需要另行安装:
In a debian/ubuntu system you can install them with:

3、apt-get install build-esse......
答案就在这里:django + nginx + uwsgi
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

oyljerry
oyljerry   Ds   Rxr 2016.04.14 22:16

no python 你的python路径没找到需要配置好

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!