Created
April 13, 2012 09:25
-
-
Save calvinchengx/2375397 to your computer and use it in GitHub Desktop.
fabfile.py (in progress)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import local, env, run | |
from fabric.context_managers import prefix | |
# we need to do this to ensure that mkvirtualenv and other bash commands are available | |
# this is because fabric uses /bin/sh by default and hence have no access to virtualenv cmds. | |
env.activate = 'source ~/.bash_profile; source `which virtualenvwrapper.sh`;' | |
def start(name="project"): | |
print("Creating a new django project named `{0}`.".format(name)) | |
print("Creating virtualenv `{0}` for this project.".format(name)) | |
local(env.activate + "mkvirtualenv --python=python2.7 --no-site-packages {0}".format(name)) | |
with prefix(env.activate + "workon {0}".format(name)): | |
local("pip install django") | |
# TODO: include arch_setup commands and mac_setup commands in fabfile. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment