view fabfile.py @ 65:cbbe7a275887

For Django 1.4, add the require_debug_false filter to the logging config.
author Brian Neal <bgneal@gmail.com>
date Sat, 14 Apr 2012 13:58:26 -0500
parents db9c66873680
children 49f704e58400
line wrap: on
line source
from fabric.api import cd, run

PYTHON = '/home/var/django-sites/virtualenvs/madeira/bin/python'
WC_DIR = '/home/var/django-sites/virtualenvs/madeira/madeira'
PROJ_DIR = WC_DIR + '/madeira'

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=settings.production --noinput') % PYTHON

    with cd(PROJ_DIR):
        run(cmd)


def cleanup():
    """
    Runs the cleanup management command.

    """
    cmd = '%s manage.py cleanup --settings=settings.production' % PYTHON

    with cd(PROJ_DIR):
        run(cmd)


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

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