Setting up Django on Snowleopard

I found this tutorial to setup django on Snowleopard. Since I realized it is a little outdated I decided to document the steps I took based on it to get this up and running.


As far as package managers on the Mac go, Homebrew is the new kid on the block, but in my opinion it outperforms Macports in many ways. So for all my installs I tend to use it as much as possible, if anything is not available it is easy to build it using it as well.

So for this tutorial we need the following:

  • Git
  • Mercurial
  • libjpg
  • pip
  • virtualenv
  • virtualenvwrapper

Installing all this is pretty straight forward:

brew install git
brew install pip && pip install mercurial
brew install libjpg
sudo easy_install virtualenv
sudo easy_install virtualenvwrapper


Virtualenv changed a little since the original tutorial so setup is done by first of all creating the directory for the environments

mkdir ~/.virtualenvs

Now the directory needs to be exported and the needs to be sourced, this is done by adding

export WORKON_HOME=$HOME/.virtualenvs
source /path/to/this/file/

to .bashrc and running

. ~/.bashrc

Now let’s create an environment by running

mkvirtualenv magicalenvironment
workon magicalenvironment

Now you are running in the magicalenvironment.

Django and the Firstapp

Finally it is time to create a file containing some basic setup

nano django-basic-requirements.txt
# Docutils for admin documentation.
# Latest Django version
-e svn+

Thats it, now it’s time to setup the app using pip and switch in the environment

pip install -E -r django-basic-requirements.txt

Time to get Django up and running startproject testapp
cd testapp
python runserver

Now we can visit an should see this

Django Testapp

Here we go a running Django development environment. Next on the agenda integrate MongoDB with Django.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.