clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository

Download raw (620 bytes)

from fabric.api import run, cd, env, local, sudo

This is how we like to do Django deployments at OSP—
quite minimalist.

env.hosts = ['']
env.path = '/path/to/remote/git/repo/'

def getdb():

def deploy():
    with cd(env.path):
        run('git pull origin master')
        run('/path/to/remote/python collectstatic --noinput')
        sudo('supervisorctl restart appname')
        # the last stop of course depends on what kind of server/supervisor is
        # running your app. With Apache it would be more likely:
        # sudo('/usr/sbin/apachectl graceful')