运行gunicorn和wsgi时,Django应用程序没有响应

时间:2017-11-10 10:48:08

标签: python django gunicorn

我已经开发了一个django应用程序,它运行良好的manage.py,但当我用下面的命令运行它

  

gunicorn project_name.wsgi:application

使用链接

开始使用
  

本地主机:8000

应用程序有一些UI按钮,当点击这些按钮时它会卡住,即没有响应只是等待下一页,这个问题不会发生在

  

python manage.py runserver

命令。

日志输出

[2017-11-10 16:07:19 +0530] [2080] [INFO] Starting gunicorn 19.6.0
[2017-11-10 16:07:19 +0530] [2080] [INFO] Listening at: 
http://127.0.0.1:8000 (2080)
[2017-11-10 16:07:19 +0530] [2080] [INFO] Using worker: sync
[2017-11-10 16:07:19 +0530] [2087] [INFO] Booting worker with pid: 2087
[<project_name: project_name object>]
[<project_name: project_name object>]
destination_path /home/ravi/lqiDemo/project_name/media/data/2017/11/8/13/64001859
[2017-11-10 16:07:54 +0530] [2080] [CRITICAL] WORKER TIMEOUT (pid:2087)
[2017-11-10 10:37:54 +0000] [2087] [INFO] Worker exiting (pid: 2087)
[2017-11-10 16:07:54 +0530] [2128] [INFO] Booting worker with pid: 2128
[2017-11-10 16:08:26 +0530] [2080] [CRITICAL] WORKER TIMEOUT (pid:2128)
[2017-11-10 10:38:26 +0000] [2128] [INFO] Worker exiting (pid: 2128)
[2017-11-10 16:08:26 +0530] [2135] [INFO] Booting worker with pid: 2135
[2017-11-10 16:08:57 +0530] [2080] [CRITICAL] WORKER TIMEOUT (pid:2135)
[2017-11-10 10:38:57 +0000] [2135] [INFO] Worker exiting (pid: 2135)
[2017-11-10 16:08:57 +0530] [2152] [INFO] Booting worker with pid: 2152

我的wsgi文件是:

import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings")
application = get_wsgi_application()

有没有解决方案?

- 编辑 编辑时

  

gunicorn project_name.wsgi --log-level = DEBUG

输出

[2017-11-10 11:33:35 +0000] [4754] [DEBUG] GET /get/file/data/
[2017-11-10 11:33:58 +0000] [4754] [DEBUG] Closing connection. 
[2017-11-10 11:33:58 +0000] [4754] [DEBUG] Closing connection. 
[2017-11-10 11:33:58 +0000] [4754] [DEBUG] Closing connection. 
[2017-11-10 11:33:58 +0000] [4754] [DEBUG] Closing connection. 

0 个答案:

没有答案