django-settings里redis连接与缓存配置

# Django-redis的缓存配置
CACHES = {
  "default": {
    "BACKEND": "django_redis.cache.RedisCache",
    "LOCATION": "redis://127.0.0.1:6379/6",
    "OPTIONS": {
      "CLIENT_CLASS": "django_redis.client.DefaultClient",
      }
    }
}
# 配置session存储
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default"

posted on 2018-10-17 16:48  A-Way  阅读(162)  评论(0编辑  收藏  举报

导航