Skip to main content

A Django Admin interface for Redis servers with optional Redis Sentinel support

Project description


With django-redis-admin you can view (and in the future, edit) your Redis databases. It supports simple servers, master slave setups and sentinel setups.

The admin works by creating a RedisQueryset which fakes Django models and querysets so the ModelAdmin thinks it’s using a regular database backed model.

Since Redis only supports basic types the library allows for optional base64 encoding/decoding and json encoding/decoding.

While I would not recommend using it as a regular queryset to access Redis. In addition to querying data it does some extra queries which you usually don’t need (such as fetching idle data) and it does some automatic conversion steps.


  • Python 3.6 and above

  • Django (tested with 2.1, probably works with any version that supports Python 3)

  • Python-redis (pip install redis)


django-redis-admin can be installed via pip.

pip install django-redis-admin

Then just add redis_admin to your INSTALLED_APPS.

Optionally, configure your servers if you have multiple and/or non-standard (i.e. non-localhost) redis servers.

Below are several example configurations. The default settings can always be found in redis_admin/

You can run the demo project using the following commands:

cd test_redis_admin
python runserver

The default username/password is admin/admin: http://localhost:8080/admin/

Basic configuration


Explicit configuration

    redis_server_a=dict(host='', port=6379, db=0),

Master slave configuration

      master=dict(host='master_hostname', port=6379, db=0),
      slave=dict(host='slave_hostname', port=6379, db=0),

Sentinel Configuration

# The `REDIS_SENTINELS` setting should be a list containing host/port
# combinations. As documented here:
REDIS_SENTINELS = [('server_a', 26379), ('server_b', 26379)]

# The `REDIS_SENTINEL_OPTIONS` are the extra arguments to
# `redis.sentinel.Sentinel`:
REDIS_SENTINEL_OPTIONS = dict(socket_timeout=0.1)

# The `service_name` is used to find the server within the Sentinel
# configuration. The dictionary key will be used as the name in the admin

Base64 and/or JSON decoding

As a convenient option all values can optionally be base64 and/or json encoded. To configure this a regular expression can be specified which will be matched against the keys.

# For all keys

# Keys starting with a pattern:
REDIS_BASE64_KEY_RE = '^some_prefix.*'

# Keys ending with a pattern:
REDIS_JSON_KEY_RE = '.*some_suffix$'

And if a specific json decoder is needed, the json module can be specified. The module needs to be importable and have a dumps and loads method. By default it simply imports the json module:


Representation cropping

Within the Django Admin list view the values are cropped by default to prevent really long lines. This size can be adjusted through:



  • Allow saving values

  • Allow deleting values

  • Support Redis Bitmaps

  • Support Redis HyperLogLogs

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-redis-admin-0.2.0.tar.gz (10.2 kB view hashes)

Uploaded Source

Built Distribution

django_redis_admin-0.2.0-py3-none-any.whl (12.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page