码迷,mamicode.com
首页 > 其他好文 > 详细

django-redis

时间:2016-01-16 01:15:05      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:

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

django-redis

标签:

原文地址:http://www.cnblogs.com/xiangnan/p/5134784.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!