Using Redis with Horizon

Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

To use Redis with Horizon first install and configure Redis on the system running the Horizon WSGI processes. Packages are available in the project server:database on the openSUSE Build Service.

# zypper install -y redis
# mv /etc/redis/default.conf.example /etc/redis/default.conf
# service redis start

Then install the package python-django-redis and the needed dependencies python-redis and python-py. Packages are soon available in the project devel:languages:python.

As last step replace the existing configuration parameters SESSION_ENGINE and CACHES in the configuration file of Horizon ( with the following lines and restart the WSGI processes afterwards.

SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
    "default": {
        "BACKEND": "redis_cache.cache.RedisCache",
        "LOCATION": "",
        "OPTIONS": {
            "CLIENT_CLASS": "redis_cache.client.DefaultClient",

Now Horizon uses Redis as cache. Verification is possible with the tool redis-cli.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>