The Squirrels Are Watching

Saving keystrokes

Posted in Code and Tech by andrewfong on May 14, 2009

Happiness comes from small victories. In order to save on unnecessary typing, I’ve made a few shortcuts in Django for my most common “python manage.py” commands.

For example, my test command is longer than most because I use a different settings file for tests to keep the environments separate. So I popped open an editor and created this:

python manage.py test $* –settings=settings_test

Save as something short — like ‘ts’, then make executable

chmod u+x ts

Now instead of typing python manage.py test … , I can simply type ./ts and be done with it. Note that things like ./ts my_app also still work

Last step: update your repository to ignore these files so you don’t accidentally piss off any others you’re working with.

Advertisements

Comments Off on Saving keystrokes

%d bloggers like this: