Django和Python uWSGI

使用instruction我尝试连接Python uWSGI.

我在一个文件夹/ home / sanya / django / pasteurl中创建了默认项目.
但是,在我得到的浏览器中打开它

uWSGI Error
wsgi application not found

日志包含以下内容:

binding on TCP port: 9001
your server socket listen backlog is limited to 64 connections
added /home/sanya/django/pasteurl to pythonpath.
initializing hooks...done.
...getting the applications list from the 'django' module...
uwsgi.applications dictionary is not defined,trying with the "applications" one...
applications dictionary is not defined,trying with the "application" callable.
static applications not defined,you have to use the dynamic one...
spawned uWSGI master process (pid: 7637)
spawned uWSGI worker 1 (pid: 7646)
spawned uWSGI worker 2 (pid: 7647)
spawned uWSGI worker 3 (pid: 7648)
spawned uWSGI worker 4 (pid: 7649)

文件/home/sanya/django/pasteurl/django.wsgi

import os
import django.core.handlers.wsgi

# init django settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'pasteurl.settings'

# define wsgi app
application = django.core.handlers.wsgi.WSGIHandler()

# mount this application at the webroot
# applications = { '/': 'application' }

我意识到,这个应用程序字典出了问题

FWIW,从1997年开始查看source code,我们看到如果无法找到应用程序字典,uWSGI会发出您正在接收的错误消息的确切序列.

看看你的django.wsgi文件,我们看到了这一行,

`applications = {'/': 'application'} 

被注释掉了.我想知道我们能做些什么;)

顺便说一下,我使用google找到了源代码.在引号中搜索错误消息通常是件好事.点击该链接后发现我很幸运能够直接从谷歌找到源代码(越来越多),我按下Ctrl-F进行“在页面上查找”并在我的浏览器中重新输入错误消息在页面搜索工具,我直接到相关的线路.

相关文章

文章浏览阅读3.7k次,点赞2次,收藏5次。Nginx学习笔记一、N...
文章浏览阅读1.7w次,点赞14次,收藏61次。我们在使用容器的...
文章浏览阅读1.4k次。当用户在访问网站的过程中遇到404错误时...
文章浏览阅读2.7k次。docker 和 docker-compose 部署 nginx+...
文章浏览阅读1.3k次。5:再次启动nginx,可以正常启动,可以...
文章浏览阅读3.1w次,点赞105次,收藏182次。高性能:Nginx ...