Ask Your Question

How do I configure memcached for Django 1.3?

asked 2012-07-24 23:25:23 -0600

Joseph gravatar image

The default caching doesn't work. (There are numerous issues due to it.)

memcached is recommended. However, the is for Django <= 1.2 caching.

How do you configure memcached for Django 1.3?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-07-24 23:27:17 -0600

Joseph gravatar image

updated 2012-07-26 12:40:22 -0600

[I will update these instructions if Evgeny tells me otherwise.]

Follow the memcache setup instructions described here: and make sure python-memcached is installed.

Then, put the following in your

    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': 'unix:/home/USERNAME/memcached.sock',
        'TIMEOUT': 18000,
        'KEY_PREFIX': 'askbot',

And disable the current CACHE_BACKEND. (The second CACHE_TIMEOUT is necessary because of a small bug.)

Also, disable the following middleware:


Otherwise you will get errors, like entire pages being cached when they shouldn't.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-07-24 23:25:23 -0600

Seen: 492 times

Last updated: Jul 26 '12