Making iPython work on Mac OS X Lion with Django Command Extensions

If you're not using iPython for Python/Django development you should be. It has a number of awesome features, but the ones I use the most are tab-autocomplete. This means you can type a word (e.g. MyObject), press Tab and see a list of attributes, methods, etc. for that object. This makes Python development way faster.

Django 2

To install ipython (v0.11 as of this writing), run:

pip install ipython

Now, assuming you have Django Command Extensions installed, if you try to launch  shell_plus using this command:

python manage.py shell_plus

You will get an error. Dang! Turns out that the iPython 0.11 is incompatible with the stable release of Django Command Extensions. This can easily be fixed:

pip uninstall django-extensions

pip install https://github.com/django-extensions/django-extensions

This will install the latest Django command extensions from source. As of this writing, I was getting a 404 on that Github url. I overcame this problem by activating my virtual environment, cloning the repository (by downloading the tar.gz) and then running this command in the downloaded repo:

python setup.py install

Since your virtual env is active, it will install Django command extensions in the right place.

We're almost done. Lastly, you need to install readline (otherwise you will get all sorts of ugly indentation errors iPython):

pip install readline

That's it! Now your can use iPython 0.11 with Django Command Extensions. Enjoy.