uWSGI返回空响应

我有一个Django网站,我试图通过uWSGI服务器。 我已经启动了这样的服务器:

uwsgi --emperor . Ctrl+Z bg 1 

(有两个.ini文件,分别指向站点的testing版本和生产版本,分别在9001和9002上)

然后我试图让我的网站:

 curl http://localhost:9002 

当我这样做的时候,我收到一条消息,说血pipe是忠诚的,但没有实际的反应。 uwsgi.log然后包含以下内容:

 [pid: 5071|app: 0|req: 2/2] 127.0.0.1 () {26 vars in 357 bytes} [Tue Jul 23 13:20:21 2013] GET / => generated 0 bytes in 1 msecs (HTTP/1.1 302) 2 headers in 96 bytes (1 switches on core 1) 

没有错误logging。

我应该说,这在重新启动之前工作得很好,所以uwsgi.ini文件应该没问题。

任何想法,我应该开始诊断这个?

我有一些问题,事实certificate,我的wsgi应用程序是返回UNICODE而不是BYTEstring(我是在python3); 并没有在日志中显示它… WSGI期望输出字节string,从不unicode。

在您的应用程序的可调用 ,而不是return "string"您应该使用return b"string"return "string".encode("utf-8")

 def application(env, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) # One of the below can be used. return "string".encode("utf-8") return b"string" 

您可以查看http://uwsgi-docs.readthedocs.io/en/latest/Python.html#python-3了解更多关于使用python3使用uwsgi的信息。