首先在setting文件中配置 CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", # 改成ubuntu的ip "OPTIONS": { "CL