pip install fabtools
python
from fabric.api import *
from fabtools import require
def install_nginx():
require.nginx.server()
def install_gunicorn():
require.deb.package('gunicorn')
def configure_servers():
require.nginx.site('example.com', template_source='nginx.conf')
require.service.started('nginx')
require.service.started('gunicorn')
def deploy():
install_nginx()
install_gunicorn()
configure_servers()
deploy()