我在我的项目中发现,django会给我这个词" uwsgi错误python应用程序找不到"。
django项目文件树
我的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应用程序'
这很奇怪,我怎么能解决它?