Deploying with Gunicorn and Supervisor
Gunicorn is a WSGI HTTP server for Unix. It is very simple to implement, ultra-light, and fairly speedy. Its simplicity lies in its broad compatibility with various web frameworks.
Supervisor is a monitoring tool that controls various child processes and handles starting/restarting these child processes when they exit abruptly, or due to some other reason. It can be extended to control processes via the XML-RPC API over remote locations without you having to log into the server (we won’t discuss this here as it is beyond the scope of this book).
One thing to remember is that these tools can be used along with the other tools mentioned in the applications in the previous recipe, such as using Nginx as a proxy server. This is left to you to try out.
Getting ready
We will start by installing both the packages – that is, gunicorn
and supervisor
. Both can be directly installed using pip
:
$ pip install gunicorn $ pip install...