<!--*-markdown-*-->

# `django-cherry`

`django-cherry` is a Django application which makes it easy to run your Django
project under the [CherryPy WSGI server][cp-wsgi]. The main command is defined
using [`django-boss`][djboss], a simple but powerful framework for creating and
running Django management commands.

  [cp-wsgi]: http://www.cherrypy.org/browser/trunk/cherrypy/wsgiserver/__init__.py
  [djboss]: http://bitbucket.org/zacharyvoase/django-boss/


## Installation

The usual:

    easy_install django-cherry # OR
    pip install django-cherry

Then just add `'djcherry'` to your `INSTALLED_APPS` setting.

You’ll need to have [`django-boss`][djboss] installed, although that will be
automatically handled by setuptools.


## Usage

`django-cherry` is used primarily from the command-line:

    $ djboss cherry --help
    usage: djboss cherry [-h] [-i INTERFACE] [-p PORT] [-s SOCKET]
                         [-t MIN_THREADS] [-m MAX_THREADS] [-l LOGGER]
    
    optional arguments:
      -h, --help            show this help message and exit
      -i INTERFACE, --interface INTERFACE
                            A TCP network interface to listen on (default:
                            127.0.0.1)
      -p PORT, --port PORT  A TCP port number to listen on (default: 8080)
      -s SOCKET, --socket SOCKET
                            The path to a UNIX socket to listen on. Overrides
                            --interface/--port. (default: None)
      -t MIN_THREADS, --min-threads MIN_THREADS
                            The minimum number of threads to use (default: 10)
      -m MAX_THREADS, --max-threads MAX_THREADS
                            The maximum number of threads to use. -1 means no
                            limit. (default: -1)
      -l LOGGER, --logger LOGGER
                            The name of the logger to use (default: django.cherry)


### Configuration

You can specify defaults for pretty much every command-line option as Django 
settings. The mappings are:

*   `DEFAULT_CHERRY_INTERFACE` to `--interface`
*   `DEFAULT_CHERRY_PORT` to `--port`
*   `DEFAULT_CHERRY_SOCKET` to `--socket`
*   `DEFAULT_CHERRY_MIN_THREADS` to `--min-threads`
*   `DEFAULT_CHERRY_MAX_THREADS` to `--max-threads`
*   `DEFAULT_CHERRY_LOGGER` to `--logger`


## (Un)license

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
