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?
- Installed memcached:
apt-get install memcached
- Installed python-memcached:
pip install python-memcached
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
精彩评论