Sunnnner

Django-setting配置Redis储存session

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# redis配置
CACHES= {
'default':{
"BACKEND": 'django_redis.cache.RedisCache',
"LOCATION": "redis://127.0.0.1:6379/2",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
"PASSWORD": "",
}
}
}

# 储存session设置
SESSION_ENGING = "django.contrib.session.backends.cache"
SESSION_CACHE_ALIAS = "default"

 Comments