44

From the django docs:

After installing Memcached itself, you'll need to install a memcached binding. There are several python memcached bindings available; the two most common are python-memcached and pylibmc.

The pylibmc docs have their own requirements:

-libmemcached 0.32 or later (last test with 0.51)
-zlib (required for compression support)
-libsasl2 (required for authentication support)

So it seems to me that I need to do the following:

-install memcached
-install libmemcached
-install zlib
-install libsas12
-install pylibmc

How/where can I do this? I've been used to just pip installing whatever I need but I can't even tell which of these are python packages. Are these bundled together anywhere?

Matt Parrilla
  • 3,171
  • 6
  • 35
  • 54

2 Answers2

94

Just do pip install python-memcached and you should be good.

As for installing memcached itself, it depends on the platform you are on.

On OS X/Linux, just run memcached in the command line.

Matt Williamson
  • 39,165
  • 10
  • 64
  • 72
  • Thanks Matt. I'm trying to get my sudo password on my server. This seems pretty straightforward but I'll let you know once I give it a go! – Matt Parrilla Oct 03 '11 at 16:10
  • 7
    Go ahead and add `sudo apt-get install libmemcached-tools` so you can use **memcstat** to tell the status of your memcached. i.e. `$ watch -n1 -d 'memcstat --servers localhost` – Jeff Sheffield Feb 10 '14 at 03:47
23

Detailed explanation here http://ilian.i-n-i.org/caching-websites-with-django-and-memcached/

The link above includes explanations for how to install Memcached on Ubuntu, how to configure it as cache engine in your Django project and how to use it.

Ilian Iliev
  • 3,217
  • 4
  • 26
  • 51