标签:
linux
apt-get install redis-server
pip install django-redis
vim /etc/redis/redis.conf
maxmemory 20mb
settings.py
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
}
}
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default"
/etc/init.d/redis-server restart
redis-cli
INFO
标签:
原文地址:http://www.cnblogs.com/xiangnan/p/5134784.html