Will & Skill Developers

Will & Skill Developers


Thoughts, snippets and ideas from the team at Will & Skill AB, Stockholm.

Faisal Mahmud
Author

“The mind is not a vessel to be filled, but a fire to be kindled.” ― Plutarch

Share


Redis as a caching backend for Django based projects

Faisal MahmudFaisal Mahmud

A tutorial for installing Redis and using it as the caching backend for Django

Installing Redis on Ubuntu

sudo apt-get install redis-server

Make sure that you are in the proper virtualenv

pip install django-redis-cache

In your settings.py add this snippet

CACHES = {
    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': 'localhost:6379',
        'OPTIONS': {
            'DB': 0,
        },
    },
}

That's it! You're done!

Faisal Mahmud
Author

Faisal Mahmud

“The mind is not a vessel to be filled, but a fire to be kindled.” ― Plutarch

Comments