Skip to content

Instantly share code, notes, and snippets.

@emperorcezar
Created January 26, 2013 20:27
Show Gist options
  • Select an option

  • Save emperorcezar/4644435 to your computer and use it in GitHub Desktop.

Select an option

Save emperorcezar/4644435 to your computer and use it in GitHub Desktop.
bash function to start development on a project.
startdev() {
# Try installing the requirements
# Only check this directory or the one above it
if [ -e ./requirements.txt ]; then
${VIRTUAL_ENV}/bin/pip install -r ./requirements.txt || true
elif [ -e ../requirements.txt ]; then
${VIRTUAL_ENV}/bin/pip install -r ../requirements.txt || true
fi
MANAGE=`find . -name 'manage.py'`
NUM_RESULTS=$(echo $MANAGE | wc -l)
if [ $NUM_RESULTS -eq 1 ]; then
MANAGE_DIR=$(dirname $MANAGE)
echo $MANAGE_DIR
DEBUG=True ${VIRTUAL_ENV}/bin/python ${MANAGE_DIR}/manage.py syncdb
DEBUG=True ${VIRTUAL_ENV}/bin/python ${MANAGE_DIR}/manage.py runserver_plus
else
echo "Found too many manage.py. exiting..."
return 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment