Skip to content

Instantly share code, notes, and snippets.

@christophermoura
Last active October 22, 2017 01:51
Show Gist options
  • Save christophermoura/012f715ef761a34dfcb251f91405767d to your computer and use it in GitHub Desktop.
Save christophermoura/012f715ef761a34dfcb251f91405767d to your computer and use it in GitHub Desktop.
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
export WORKON_HOME=~/.envs
export PROJECT_HOME=~/Documentos/pythonprojects
export PATH=$HOME/.bin:$PATH
eval "$(pyenv init -)"
pyenv virtualenvwrapper_lazy
alias deploygithub='git push -u --force origin master'
alias deployheroku='git push -u --force heroku master'
alias acertavolume='pkill -RTMIN+1 i3blocks'
# Criar aliases no script postactivate do virtualenv
echo "alias manage=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias test=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py test\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias startapp=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py startapp\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias runserver=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py runserver\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias testm=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py test --nomigrations\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias makemigrations=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py makemigrations\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias migrate=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py migrate\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias shell=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py shell\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias shellp=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py shell_plus\"" >> $VIRTUAL_ENV/bin/postactivate
echo "alias createsuperuser=\"$VIRTUAL_ENV/bin/python $(pwd)/manage.py createsuperuser\"" >> $VIRTUAL_ENV/bin/postactivate
# Destruir aliases no script postdeactivate do virtualenv
echo "unalias manage" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias test" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias startapp" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias runserver" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias testm" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias makemigrations" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias migrate" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias shell" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias shellp" >> $VIRTUAL_ENV/bin/postdeactivate
echo "unalias createsuperuser" >> $VIRTUAL_ENV/bin/postdeactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment