CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", # "LOCATION": "127.0.0.1:6379:3", "LOCATION": "redis://127.0.0.1:6379/3", 'TIMEOUT': 600,# 缓存超时时间(默认300,None表示永不过期,0表示立即过期 "OPTIONS": { "PASSWORD": "", "CLIENT_CLASS": "django_redis.client.DefaultClient", }, }, }
正常来讲要设置成图示的这样,但是会报bug,改成
"LOCATION": "127.0.0.1:6379:3",
就好了,不知道为什么