Arthur Neves
Arthur Neves

Reputation: 12128

django using memcached cache backend — am I doing it right?

I am changing my backend cache strategy from filesystem to Memcached! My question is am I doing all steps right?

  1. Installed memcached: apt-get install memcached
  2. Installed python-memcached: pip install python-memcached
  3. Changed my CACHES variable in the settings to this:

    CACHES = {
        'default': {
            'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
            'LOCATION': '127.0.0.1:11211',
        }
    }
    

It is just those three steps?! Or am I missing something?

Also, do I need to start the memcached server, or will Django start it automatically?

Thanks.

Upvotes: 3

Views: 1567

Answers (1)

Tommaso Barbugli
Tommaso Barbugli

Reputation: 12031

Django does not manage start itself memcached or other services, you have to run memcached yourself.

I always try to connect to memcached myself to see if it's up and running (and accepting connections as well) using:

telnet 127.0.0.1 11211

Upvotes: 4

Related Questions