Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 666 Bytes

redis_cache.rst

File metadata and controls

31 lines (22 loc) · 666 Bytes

Redis Cache

reference-linux-redis-instalar_redis.

pip install django-redis

Configuración en settings.py

# Redis CACHE
CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": "redis://127.0.0.1:6379/1",
        "OPTIONS": {
            "CLIENT_CLASS": "django_redis.client.DefaultClient",
        }
    }
}

# Poner sessions con redis
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default"