Chaussette allows you to run a Django project. You just need to provide the
Python import path of the WSGI application, commonly located in the Django
project’s wsgi.py file. For further information about how the wsgi.py
file should look like see the Django documentation.

Here’s an example:

$ chaussette --backend gevent mysite.wsgi.application
Application is <django.core.handlers.wsgi.WSGIHandler object at 0x10ec3f350>
Serving on localhost:8080
Using <class 'chaussette.backend._gevent.Server'> as a backend

The typical use case is to run Chaussette processes under a process
and socket manager. Chaussette was developed to run under Circus, which takes care of binding the
socket and spawning Chaussette processes.

To run your WSGI application using Circus, define a socket section in your
configuration file, then add a Chaussette watcher.

Supervisor includes a socket manager since
version 3.0a7, released in 2009. It was originally developed to support
FastCGI processes and thus the configuration section is called
fcgi-program. Despite the name, it is not tied to the FastCGI protocol.
Supervisor can bind the socket and then spawn Chaussette processes.

To run your WSGI application using Supervisor, define an fcgi-program
section in your configuration file.

Chaussette is just a bit of glue code on the top of existing WSGI servers,
and is organized around back ends.

By default Chaussette uses a pure Python implementation based on wsgiref,
but it also provides more efficient back ends. Most of them are for Python 2
only, but Chaussette can be used under Python 3 with a few of them - marked in the
list below:

gevent – based on Gevent’s pywsgi server

fastgevent – based on Gevent’s wsgi server – faster but does not
support streaming.

Most WGSI servers out there provide advanced features to scale your web
applications, like multi-threading or multi-processing. Depending on the
project, the process management features, like respawning processes that
die, or adding new ones on the fly, are not always very advanced.

On the other hand, tools like Circus and Supervisor have more advanced
features to manage your processes, and are able to manage sockets as well.

The goal of Chaussette is to delegate process and socket management to
its parent process and just focus on serving requests.

Using a pre-fork model, the process manager binds a socket. It then forks
Chaussette child processes that accept connections on that socket.