Source

django-template-project / fabfile.py

Full commit
import os
from fabric.api import local, lcd


VIRTUAL_ENV_DIR = 'virtualenv'
PROJECT_NAME = 'django-template-project'

def get_virtual_env_bin(command):
    path = os.path.join(VIRTUAL_ENV_DIR, PROJECT_NAME, 'bin')
    if command:
        path = os.path.join(path, command)
    return path

def create_virtualenv():
    if not os.path.isdir(VIRTUAL_ENV_DIR):
        os.mkdir(VIRTUAL_ENV_DIR)
    with lcd(VIRTUAL_ENV_DIR):
        local('virtualenv --distribute ' + PROJECT_NAME)
    local(get_virtual_env_bin('pip') + ' install -r requirements.txt')