mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Simplify installation instructions in gunicorn.org
This commit is contained in:
parent
6dcd7a6ada
commit
3ccdafbb62
@ -66,31 +66,19 @@
|
|||||||
<div class="tab-box active" data-tab="quickstart">
|
<div class="tab-box active" data-tab="quickstart">
|
||||||
<h1>Installation</h1>
|
<h1>Installation</h1>
|
||||||
<p>
|
<p>
|
||||||
Here's a quick rundown on how to get started with Gunicorn. For more detail read the documentation.
|
Here's a quick rundown on how to get started with Gunicorn. For more details read the <a href="http://docs.gunicorn.org/en/stable/">documentation</a>.
|
||||||
</p>
|
</p>
|
||||||
<pre>
|
<pre>
|
||||||
$ sudo pip install virtualenv
|
$ pip install gunicorn
|
||||||
$ mkdir ~/environments/
|
$ cat myapp.py
|
||||||
$ virtualenv ~/environments/tutorial/
|
def app(environ, start_response):
|
||||||
$ cd ~/environments/tutorial/
|
data = b"Hello, World!\n"
|
||||||
$ ls
|
start_response("200 OK", [
|
||||||
bin include lib
|
("Content-Type", "text/plain"),
|
||||||
$ source bin/activate
|
("Content-Length", str(len(data)))
|
||||||
(tutorial) $ pip install gunicorn
|
])
|
||||||
(tutorial) $ mkdir myapp
|
return iter([data])
|
||||||
(tutorial) $ cd myapp/
|
$ gunicorn -w 4 myapp:app
|
||||||
(tutorial) $ vi myapp.py
|
|
||||||
(tutorial) $ cat myapp.py
|
|
||||||
|
|
||||||
def app(environ, start_response):
|
|
||||||
data = b"Hello, World!\n"
|
|
||||||
start_response("200 OK", [
|
|
||||||
("Content-Type", "text/plain"),
|
|
||||||
("Content-Length", str(len(data)))
|
|
||||||
])
|
|
||||||
return iter([data])
|
|
||||||
|
|
||||||
(tutorial) $ ../bin/gunicorn -w 4 myapp:app
|
|
||||||
[2014-09-10 10:22:28 +0000] [30869] [INFO] Listening at: http://127.0.0.1:8000 (30869)
|
[2014-09-10 10:22:28 +0000] [30869] [INFO] Listening at: http://127.0.0.1:8000 (30869)
|
||||||
[2014-09-10 10:22:28 +0000] [30869] [INFO] Using worker: sync
|
[2014-09-10 10:22:28 +0000] [30869] [INFO] Using worker: sync
|
||||||
[2014-09-10 10:22:28 +0000] [30874] [INFO] Booting worker with pid: 30874
|
[2014-09-10 10:22:28 +0000] [30874] [INFO] Booting worker with pid: 30874
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user