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": "密码",
            "DECODE_RESPONSES":True
        }
    },
}

from django.core.cache import cache




cache.set('server_md5_token', 'd', 10)



res = cache.has_key('server_md5_token')

 

相关文章:

  • 2021-06-12
  • 2022-02-08
  • 2022-01-15
  • 2021-12-03
  • 2021-11-23
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案