Installing memcached for Django

Memcached is very popular caching system with API available for many languages and environments. Today I installed it on my OS X development server that runs Django. These instructions might be helpful if you’re up to the same task.

Memcached needs an event notification library libevent to run. After downloading the source code from libevent public repository go ahead and unpack it. Open terminal in the folder you have unpacked the source code and type

./autogen.sh
./configure
make
make verify
sudo make install

This should be it for libevent.

Now to the memcached.

curl -O http://memcached.org/latest
tar -zxvf memcached-1.x.x.tar.gz
cd memcached-1.x.x
./configure
make && make test
sudo make install

And last but not least you will need Python-memcached installed. It’s very easy if you have pip and I highly recommend getting it if you don’t. Here’s the line

pip install python-memcached

This is really easy if you don’t run into errors. Which I did when I tried to install it on a hosted server. I didn’t get past ‘make verify’ command for the libevent. I’ll have to do some digging and I will give you a report on my progress. Keep reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>