开发者

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:

    CACHE开发者_StackOverflow社区S = {
        '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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜