django uwsgi没有加载app

时间:2012-08-16 03:21:36

标签: python django uwsgi

在Ubuntu 12.04上遇到uwsgi和django项目的麻烦 uwsgi运行正常,但看不到任何应用程序。

我的项目位于 / home / satchitananda / PycharmProjects / dbTest / 目录中。

nginx config:

server {
root /usr/share/nginx/www;
index index.html index.htm;

server_name somehost;


location / {
            uwsgi_pass unix:///var/run/uwsgi/app/projectname/socket;
            include uwsgi_params;
}


location /doc {
    root /usr/share;
    autoindex on;
    allow 127.0.0.1;
    deny all;
}
}

uwsgi config:

[uwsgi]
plugins = python27
virtualenv=/home/satchitananda/.env4/
pythonpath = ..
thread=3
master=1
env = DJANGO_SETTINGS_MODULE=dbTest.dbTest.settings
module = django.core.handlers.wsgi:WSGIHandler()
chdir = /home/satchitananda/PycharmProjects/dbTest/
#socket = /var/run/uwsgi/app/projectname/socket
logto = /var/log/uwsgi/projectname.log
touch-reload = /home/satchitananda/PycharmProjects/dbTest/  

uwsgi日志:

Thu Aug 16 09:29:57 2012 - *** Starting uWSGI 1.0.3-debian (64bit) on [Thu Aug 16 09:29:57 2012] ***
Thu Aug 16 09:29:57 2012 - compiled with version: 4.6.3 on 17 July 2012 02:26:54
Thu Aug 16 09:29:57 2012 - current working directory: /
Thu Aug 16 09:29:57 2012 - writing pidfile to /run/uwsgi/app/projectname/pid
Thu Aug 16 09:29:57 2012 - detected binary path: /usr/bin/uwsgi-core
Thu Aug 16 09:29:57 2012 - setgid() to 33
Thu Aug 16 09:29:57 2012 - setuid() to 33
Thu Aug 16 09:29:57 2012 - your memory page size is 4096 bytes
Thu Aug 16 09:29:57 2012 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/projectname/socket fd 5
Thu Aug 16 09:29:57 2012 - your server socket listen backlog is limited to 100 connections
Thu Aug 16 09:29:57 2012 - *** Operational MODE: preforking ***
Thu Aug 16 09:29:57 2012 - *** no app loaded. going in full dynamic mode ***
Thu Aug 16 09:29:57 2012 - *** uWSGI is running in multiple interpreter mode ***
Thu Aug 16 09:29:57 2012 - spawned uWSGI master process (pid: 22335)
Thu Aug 16 09:29:57 2012 - spawned uWSGI worker 1 (pid: 22337, cores: 1)
Thu Aug 16 09:29:57 2012 - spawned uWSGI worker 2 (pid: 22339, cores: 1)

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

您使用#禁用套接字现在是注释

socket = /var/run/uwsgi/app/projectname/socket

我不确定,但默认项目设置看起来像dbTest.settings而不是dbTest.dbTest.settings

env = DJANGO_SETTINGS_MODULE=dbTest.settings