Aliases for Virtualenv

07.15.2014

I've been using the following aliases in conjunction with virtualenv wrapper a while now:

alias v="workon"
alias v.mk="mkvirtualenv"

I got them from this blog post

This makes virtualenv activation and creation pretty damn easy! But today I wanted to get a little more out of them. So I just quickly made this:

alias wk.frankvalcarcel.com="v pelican &&  cd /Users/frankv/Work/frankvalcarcel.com"

And now I can quickly activate the virtualenv and change to the corresponding directory with one command! Awesome! But... I'm really really LAZY! I want it to do more!

My projects and work environments don't differ very much. They're either a Flask or Django project with a related virtualenv, or this pelican site. That's really it for 90% of my system's work environments. So I'm thinking of a script that could not only activate an env and change directories but maybe also: start the server for me, run a fab or manage command, start dependent services like Redis or Mongo, or even open the directory in Finder or Sublime or Vim... The list goes on!

I'll put some thought into this and see if I come up with something. If you have a suggestion, please tell it to me in the comments!

BASH, Python, VirtualenvWrapper

Latest Posts

The Martian.

This book was absolutely riveting. It kept me up two nights in a row and had me imagining amber Martian landscapes around the clock. The author, Andy Weir, was previously a software engineer,...

Pragmatic MVP, References

The Pragmatic MVP is a talk I gave at TalTech Expo 2015 on building effective early stage prototypes. Below is a list of websites, articles, and books I used in preparation...

Iterables in Segments

Start with an iterable (list, tuple, set, etc.) and loop through it. Only instead of taking one element at a time, grab a segment....

Comments