Skip to content

Commit

Permalink
Fix deployment doc
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Feb 9, 2018
1 parent bb2b3d4 commit 3092d4c
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions docs/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,27 +207,23 @@ Prepare environment
-------------------

You firstly need to setup your deployment environment. This example is
based on `Ubuntu` 14.04.
based on `Ubuntu <https://www.ubuntu.com/>`_ 16.04.

Create a directory for your application::

>> mkdir myapp
>> cd myapp

`Ubuntu` has a bug in pyenv, so to create virtualenv you need to do some
extra manipulation::
Create Python virtual environment::

>> pyvenv-3.4 --without-pip venv
>> source venv/bin/activate
>> curl https://bootstrap.pypa.io/get-pip.py | python
>> deactivate
>> python3 -m venv venv
>> source venv/bin/activate

Now that the virtual environment is ready, we'll proceed to install
aiohttp and gunicorn::

>> pip install gunicorn
>> pip install -e git+https://github.com/aio-libs/aiohttp.git#egg=aiohttp
>> pip install aiohttp


Application
Expand Down Expand Up @@ -267,15 +263,12 @@ In this case, we will use:
documentation for recommendations on `How Many Workers?
<http://docs.gunicorn.org/en/latest/design.html#how-many-workers>`_)

The custom worker subclass is defined in
*aiohttp.GunicornWebWorker* and should be used instead of the
*gaiohttp* worker provided by Gunicorn, which supports only
aiohttp.wsgi applications::
The custom worker subclass is defined in ``aiohttp.GunicornWebWorker``::

>> gunicorn my_app_module:my_web_app --bind localhost:8080 --worker-class aiohttp.GunicornWebWorker
[2015-03-11 18:27:21 +0000] [1249] [INFO] Starting gunicorn 19.3.0
[2015-03-11 18:27:21 +0000] [1249] [INFO] Listening at: http://127.0.0.1:8080 (1249)
[2015-03-11 18:27:21 +0000] [1249] [INFO] Using worker: aiohttp.worker.GunicornWebWorker
[2017-03-11 18:27:21 +0000] [1249] [INFO] Starting gunicorn 19.7.1
[2017-03-11 18:27:21 +0000] [1249] [INFO] Listening at: http://127.0.0.1:8080 (1249)
[2017-03-11 18:27:21 +0000] [1249] [INFO] Using worker: aiohttp.worker.GunicornWebWorker
[2015-03-11 18:27:21 +0000] [1253] [INFO] Booting worker with pid: 1253

Gunicorn is now running and ready to serve requests to your app's
Expand Down Expand Up @@ -304,7 +297,7 @@ Logging configuration

By default aiohttp uses own defaults::

'%a %l %u %t "%r" %s %b "%{Referrer}i" "%{User-Agent}i"'
'%a %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'

For more information please read :ref:`Format Specification for Access
Log <aiohttp-logging-access-log-format-spec>`.

0 comments on commit 3092d4c

Please sign in to comment.