Setting up the VM :
1. Downloaded VirtualBox.
2. Downloaded Ubuntu ( ubuntu-11.10-desktop-amd64 ).
3. Created a new virtual machine and installed Ubuntu. Rather painless, virtual box was very handy.
Setting up Django and Python environments:
1. Got pip which is a Python package installer, also virtualenv and virtualenvwrapper:
$ sudo apt-get install python-pip pip install virtualenv pip install virtualenvwrapper
2. Edited the bashrc file with vim, added these 2 lines at the bottom:
$ export WORKON_HOME=~/dev/py $ source /usr/local/bin/virtualenvwrapper.sh
Note that if you’ve read other articles on how to install/configure virtualenv and virtualenvwrapper they tend to set up the WORKON_HOME as something like ~/.virtualenvs which I don’t like. Why should your virtualenvs be hidden? No point…
Also, that might not be where your virtualenvwrapper.sh got installed to, you might have to do a little look around.
4. Then refreshed bashrc by reloading the bash:
$ source ~/.bashrc
5. Created a new virtualenv with no site packages to start with a clean slate. That way I can later save a list of the packages required by the project without worrying about any other unrelated packages.
$ mkvirtualenv --no-site-packages django_mongo1
6. Tried to get pip to install stuff straight from repos online but it spat errors back at me. Apparently Ubuntu didn’t come with Git or Mercurial pre-installed so I had to get those and then get the pip packages required. Remembering always to force pip to only install to the virtualenv I want by using the -E option.
What I’m installing: http://django-mongodb.org/topics/setup.html
$ sudo apt-get install git $ sudo apt-get install Mercurial $ pip install hg+https://bitbucket.org/wkornewald/django-nonrel -E ~/dev/py/django_mongo1 $ pip install hg+https://bitbucket.org/wkornewald/djangotoolbox -E ~/dev/py/django_mongo1 $ pip install git+https://github.com/django-nonrel/mongodb-engine -E ~/dev/py/django_mongo1