标签:col host def 配置 location 密码 color 两种 back
setting.py
import redis REDIS_DB = redis.Redis(host=‘127.0.0.1‘,port=6379,db=1) #db = 默认为1
还可以这样的配置
# redis 的配置文件 CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", "CONNECTION_POOL_KWARGS": {"max_connections": 100} # "PASSWORD": "密码", } } }
两种方法各有各的用途,懵逼的很
标签:col host def 配置 location 密码 color 两种 back
原文地址:https://www.cnblogs.com/qinzeiqinwang/p/hhh111.html