<commit_before>fabric-gunicorn
===============

Control your gunicorn process with fabric.

.. image:: http://files.thelabmill.de/fabric-gunicorn/fabric-gunicorn-status-start-stop.png

Install
-------

The installation is thanks to the Python Package Index and `pip <http://www.pip-installer.org/>`_ really simple.

::

   $ pip install fabric-gunicorn


First steeps
------------

Add ``import fabric_gunicorn as gunicorn`` to your new or existing fabfile.py. After this you should go in your termianl and run ``fab -l`` in your project directory. You will see something like this:

::

    Available commands:
    
    gunicorn.add_worker     Increase the number of your gunicorn workers
    gunicorn.reload         Reload gracefully the gunicorn process and the wsgi application
    gunicorn.remove_worker  Decrease the number of your gunicorn workers
    gunicorn.restart        Restart hard the gunicorn process
    gunicorn.start          Start the gunicorn process
    gunicorn.status         Show the current status of your gunicorn process
    gunicorn.stop           Stop the gunicorn process


Befor you can start a gunicorn process on your server you must set the gunicorn_wsgi_app env variable. Edit your fabfile.py and add something like: ``env.gunicorn_wsgi_app = 'hello.wsgi:app'``. The default workdir is the home directory of the connected user. You can also change this path with the env variable ``env.remote_workdir``.

Normaly you should now able to run ``fab gunicorn.start`` and the gunicorn server should start on your remote machine. Gunicorn must be installed.
Your wsgi app is now avaiable under ``http://127.0.0.1:8000``.

Configuration
-------------

fabric-gunicorn take all configuration from the fabric env variable. For gunicorn I added some variables:

env.remote_workdir
  This is normaly your project path.

env.virtualenv_dir
  If you want to use a virtualenv than you can here define the path to your 
  env directory.

env.gunicorn_wsgi_app
  There you set your wsgi app import path.
  Example: ``mydjangoproject.wsgi:application``
  
env.gunicorn_bind
  Define on which port or socket gunicorn should bind.
  Default: ``127.0.0.1:8000``

env.gunicorn_pidfile<commit_msg>Update master<commit_after>fabric-gunicorn
===============

Control your gunicorn process with fabric.

.. image:: http://files.thelabmill.de/fabric-gunicorn/fabric-gunicorn-status-start-stop.png

Install
-------

The installation is thanks to the Python Package Index and `pip <http://www.pip-installer.org/>`_ really simple.

::

   $ pip install fabric-gunicorn


First steeps
------------

Add ``import fabric_gunicorn as gunicorn`` to your new or existing fabfile.py. After this you should go in your termianl and run ``fab -l`` in your project directory. You will see something like this:

::

    Available commands:
    
    gunicorn.add_worker     Increase the number of your gunicorn workers
    gunicorn.reload         Reload gracefully the gunicorn process and the wsgi application
    gunicorn.remove_worker  Decrease the number of your gunicorn workers
    gunicorn.restart        Restart hard the gunicorn process
    gunicorn.start          Start the gunicorn process
    gunicorn.status         Show the current status of your gunicorn process
    gunicorn.stop           Stop the gunicorn process


Befor you can start a gunicorn process on your server you must set the gunicorn_wsgi_app env variable. Edit your fabfile.py and add something like: ``env.gunicorn_wsgi_app = 'hello.wsgi:app'``. The default workdir is the home directory of the connected user. You can also change this path with the env variable ``env.remote_workdir``.

Normaly you should now able to run ``fab gunicorn.start`` and the gunicorn server should start on your remote machine. Gunicorn must be installed.
Your wsgi app is now avaiable under ``http://127.0.0.1:8000``.

Configuration
-------------

fabric-gunicorn take all configuration from the fabric env variable. For gunicorn I added some variables:

env.remote_workdir
  This is normaly your project path.

env.virtualenv_dir
  If you want to use a virtualenv than you can here define the path to your 
  env directory.

env.gunicorn_wsgi_app
  There you set your wsgi app import path.
  Example: ``mydjangoproject.wsgi:application``
  
env.gunicorn_bind
  Define on which port or socket gunicorn should bind.
  Default: ``127.0.0.1:8000``

env.gunicorn_pidpath
{'fraction_non_alphanumeric': 0.07960199004975124, 'fraction_numerical': 0.009045680687471733, 'mean_word_length': 3.4858012170385395, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4059041', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1203, 'n_words': 520}