Rick Hurst Web Developer in Bristol, UK


Notes on deplying django with virtualenv mod_wsgi and apache on ubuntu

As i’ve exclusively been using app engine in my day job at Potato, I haven’t yet had to deal with deploying a django site on my own Ubuntu server yet. I knew that I would be using virtualenv, apache and mod_wsgi, but hadn’t yet worked out how this is done.

Rather than repeating it all here – I followed most of the steps in this blog post.

However, there were a few points where things didn’t go to plan:-

First of all I got the ubiquitous mysql_config not found error when attempting to install:-

pip install mysql-python

So, apparently the solution is to install libmysqlclient-dev:-

sudo apt-get install libmysqlclient-dev

However, if you get this error:-

error: command 'gcc' failed with exit status 1

You need to install python-dev:-

sudo apt-get install python-dev