Useful Shell Aliases For Python (and Django) Developers

Developers and hackers prefer using terminal and spend a lot of time on it. Instead of typing long commands over and over, they can be aliased to shortnames. The shell builtin alias allows users to set aliases.

One of the most used command while setting up development environment is pip install -r requirements.txt This can be aliased to pir.

alias pir='pip install -r requirements.txt

Now to install requirements, type pir and pressing enter. Here are some other aliases related to python which will be useful on a daily basis.

alias py='python'
alias ipy='ipython'
alias py3='python3'
alias ipy3='ipython3'

alias jn='jupyter notebook'

alias wo='workon'
alias pf='pip freeze | sort'
alias pi='pip install'
alias pun='pip uninstall'

alias dj="python"
alias drs="python runserver"
alias drp="python runserverplus"
alias dsh="python shell"
alias dsp="python shell_plus"
alias dsm="python schemamigration"
alias dm="python migrate"
alias dmm="python makemigration"
alias ddd="python dumpdata"
alias dld="python loaddata"
alias dt="python test"

Just add the above aliases to your ~/.bashrc or ~/.zshrc. That's it. Hpy alsng!

I am Chillar Anand. I daydream a lot and write about the things that interest me here. You can read more about this blog here.

See all articles


Edit this page