Redis
Redis is used for caching to improve the performance and scalability of the application by reducing the load on the database.
Setup and Integration
Install Redis: This works only on macOS
sudo apt-get install redis-serverStart Redis:
redis-serverIntegrate with Django: Install
django-redis
pip install django-redisConfigure Django settings
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/1',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
}
}
}
Last updated