欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Gunicorn
来自开放百科 - 灰狐
(版本间的差异)
(以“Gunicorn: Python WSGI HTTP Server ==简介== ==指南== $ pip install gunicorn $ cat myapp.py def app(environ, start_response): data = b"Hello, World...”为内容创建页面) |
小 (→指南) |
||
第6行: | 第6行: | ||
$ pip install gunicorn | $ pip install gunicorn | ||
$ cat myapp.py | $ cat myapp.py | ||
− | + | def app(environ, start_response): | |
− | + | """Simplest possible application object""" | |
− | + | data = 'Hello, World!\n' | |
− | + | status = '200 OK' | |
− | + | response_headers = [ | |
− | + | ('Content-type','text/plain'), | |
− | + | ('Content-Length', str(len(data))) | |
− | + | ] | |
− | + | start_response(status, response_headers) | |
− | + | return iter([data]) | |
− | + | $ gunicorn -w 4 myapp:app | |
− | + | [2017-07-16 15:12:27 +0800] [76775] [INFO] Starting gunicorn 19.6.0 | |
− | + | [2017-07-16 15:12:27 +0800] [76775] [INFO] Listening at: http://127.0.0.1:8000 (76775) | |
− | + | [2017-07-16 15:12:27 +0800] [76775] [INFO] Using worker: sync | |
+ | [2017-07-16 15:12:27 +0800] [76779] [INFO] Booting worker with pid: 76779 | ||
+ | [2017-07-16 15:12:27 +0800] [76780] [INFO] Booting worker with pid: 76780 | ||
+ | [2017-07-16 15:12:27 +0800] [76781] [INFO] Booting worker with pid: 76781 | ||
+ | [2017-07-16 15:12:27 +0800] [76782] [INFO] Booting worker with pid: 76782 | ||
==项目== | ==项目== |
2017年7月16日 (日) 07:13的版本
Gunicorn: Python WSGI HTTP Server
目录 |
简介
指南
$ pip install gunicorn $ cat myapp.py def app(environ, start_response): """Simplest possible application object""" data = 'Hello, World!\n' status = '200 OK' response_headers = [ ('Content-type','text/plain'), ('Content-Length', str(len(data))) ] start_response(status, response_headers) return iter([data])
$ gunicorn -w 4 myapp:app
[2017-07-16 15:12:27 +0800] [76775] [INFO] Starting gunicorn 19.6.0 [2017-07-16 15:12:27 +0800] [76775] [INFO] Listening at: http://127.0.0.1:8000 (76775) [2017-07-16 15:12:27 +0800] [76775] [INFO] Using worker: sync [2017-07-16 15:12:27 +0800] [76779] [INFO] Booting worker with pid: 76779 [2017-07-16 15:12:27 +0800] [76780] [INFO] Booting worker with pid: 76780 [2017-07-16 15:12:27 +0800] [76781] [INFO] Booting worker with pid: 76781 [2017-07-16 15:12:27 +0800] [76782] [INFO] Booting worker with pid: 76782
项目
图集
链接
分享您的观点