1. 程式人生 > >django-settings裡redis連線與快取配置

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"