view fabfile.py @ 631:f36d1a168be7

For issue 27, disable login dialog button during POST. This seems to prevent multiple logins most of the time. You can still bang on the enter key and sometimes get more through.
author Brian Neal <bgneal@gmail.com>
date Wed, 14 Nov 2012 20:57:05 -0600
parents a7968613c469
children d9d6b4b8bab7
line wrap: on
line source
from fabric.api import cd, run

PYTHON = '/home/var/django-sites/virtualenvs/sg101/bin/python'
PROJ_DIR = '/home/var/django-sites/virtualenvs/sg101/sg101'

def update():
    """
    Runs hg pull --update to pull changes and update to them.

    """
    with cd(PROJ_DIR):
        run('hg pull --update')


def collectstatic():
    """
    Runs the staticfiles collectstatic command to deploy static assets.

    """
    cmd = ('%s manage.py collectstatic '
        '--settings=sg101.settings.production --noinput') % PYTHON

    with cd(PROJ_DIR):
        run(cmd)


def touch():
    """
    Touches the wsgi file to reload the Python code.

    """
    with cd(PROJ_DIR):
        run('touch ./sg101/apache/sg101.wsgi')