zoukankan      html  css  js  c++  java
  • Django 之Redis配置

    目的:访问服务器频繁的读取数据库 ,会耗损服务器性能及降低用户体验,为此引入Redis 

    1,安装 redis(2.10.6兼容性更好)

    pip install redis

    2,settings.py配置

    #配置缓存系统
    CACHES = {
        "default": {
            "BACKEND": "django_redis.cache.RedisCache",
            "LOCATION": "redis://127.0.0.1:6379", 
            "OPTIONS": {
                "CLIENT_CLASS": "django_redis.client.DefaultClient",
            }
        }
    }
  • 相关阅读:
    bzoj1009
    bzoj1576 3694
    bzoj3143
    bzoj1391
    bzoj2729
    bzoj2653
    bzoj3261
    bzoj2326
    人件
    优秀的产品
  • 原文地址:https://www.cnblogs.com/xcsg/p/10564467.html
Copyright © 2011-2022 走看看