设置数据库后找不到django uwsgi错误python应用程序?

时间:2015-11-11 10:59:29

标签: python django uwsgi

我在我的项目中发现,django会给我这个词" uwsgi错误python应用程序找不到"。

django项目文件树

  • /家
  • - /家庭/ imagepro
  • - / home / imagepro / env #virtualenv
  • - / home / imagepro / picpro #django project
  • - / home / imagepro / picpro / picapp #django application
  • - /家庭/ imagepro / picpro / picpro

我的uwsgi设置,文件名为pic.ini

[uwsgi]
vhost = true
plugins = python
socket = /tmp/pic.sock
master = true
enable-threads = true
processes = 4
wsgi-file = /home/imagepro/picpro/picpro/wsgi.py
virtualenv = /home/imagepro/env
chdir = /home/imagepro/picpro
touch-reload = /home/imagepro/picpro/reload

我的nginx设置,文件名为pic

server {
    listen  80;
    server_name www.mydomain.com;
    root /home/imagepro;
    access_log /var/log/nginx/imagepro.access.log;
    error_log /var/log/nginx/imagepro.error.log;
    location / {
        uwsgi_pass  unix:///tmp/pic.sock;
        include     uwsgi_params;
    }
}

一块django setings.py

DEBUG = True

ALLOWED_HOSTS = ['*']
......#here DATABASE setting
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'dbname',
        'USER': 'username',
        'PASSWORD': 'pass',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}

此处有DATABASES设置,请注意,请访问www.mydomain.com',它显示“它有效!”#39; ,但如果我将DATABASES添加到settings.py中。访问' www.mydomain.com',它显示未找到&uwsgi错误python应用程序'

这很奇怪,我怎么能解决它?

0 个答案:

没有答案