Skip to content

Instantly share code, notes, and snippets.

@nurv
Created March 31, 2014 15:26
Show Gist options
  • Save nurv/9894895 to your computer and use it in GitHub Desktop.
Save nurv/9894895 to your computer and use it in GitHub Desktop.
#python manage.py anywhere
_pmanage_backsearch(){
if [ ! -f manage.py ]; then
if [[ `pwd` == "/" ]]; then
echo "Not within a Django Project"
else
cd ..
_pmanage_backsearch
fi
else
if [[ $dir != `pwd` ]]; then
echo "$fg[green]Using `pwd`$reset_color"
fi
python manage.py $args
fi
}
function _pmanage(){
local dir=`pwd`
local args=$@
_pmanage_backsearch
cd $dir
}
alias p=_pmanage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment