Skip to main content

Redisdb

Wheel Status Latest Version License Build status Coverage Documetation

Django-redisdb is Redis backend for Django that allows using Redis as a cache and as a database at the same time. Django-redisdb provides backends for master/master and sharded configuration.

Installation

pip install django-redisdb

Quick usage guide

In settings.py:

CACHES = {
    'redis_ring': {
        'BACKEND': 'redisdb.backends.RedisRing',  # sharding backend
        'DB': 0,
        'LOCATION': [
            'localhost:6379',
            'localhost:6380',
        ],
    },
    'redis_copy': {
        'BACKEND': 'redisdb.backends.RedisCopy',  # copying backend
        'DB': 0,
        'LOCATION': [
            'localhost:6379',
            'localhost:6380',
        ],
    }
}

Usage:

>>> from django.core.cache import caches
>>> caches['redis_ring'].set('one_key', 123)  # set key1 only on on server
[True]
>>> caches['redis_copy'].set('other_key', 234)  # set key2 on all servers
[True, True]

With RedisRing value is set only on one node. With RedisCopy it’s set on all nodes (two nodes in examle above).

Redis is much more powerfull then simple cache. It should be seen as a specialized database. With django-redisdb you can use all its power. For example you can use redis’ sorted sets:

>>> caches['redis_copy'].zadd('myzset', 1, 'one')
[0, 1]
>>> caches['redis_copy'].zadd('myzset', 2, 'two')
[0, 1]
>>> caches['redis_copy'].zadd('myzset', 3, 'three')
[0, 1]
>>> caches['redis_copy'].zrange('myzset', 0, -1)
['one', 'two', 'three']
>>> caches['redis_copy'].zrange('myzset', 0, -1, withscores=True)
[('one', 1.0), ('two', 2.0), ('three', 3.0)]

Supported Django versions

django-redisdb runs on Django 1.2 to Django 1.8

Documentation

Full documentation is available at http://django-redisdb.readthedocs.org

Metadata

Release files for django-redisdb 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-redisdb 0.2.1
File Size Uploaded Provenance Actions
django-redisdb-0.2.1.tar.gz 5.1 kB Without provenance Details for django-redisdb-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-redisdb 0.2.1
File Interpreter ABI Platform Actions
django_redisdb-0.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for django_redisdb-0.2.1-py2.py3-none-any.whl

Total release size: 12.2 kB

Release files / django-redisdb-0.2.1.tar.gz

Download URL django-redisdb-0.2.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c162a391c61f2598ca9fd7e2a0a8276c0156e2ea92ea35626d4da36e90349310
BLAKE2b-256 checksum
How to use checksums
702fb248e831e86147a7571ad98a87f746a7e98b6b5bd0b80d3afbee30cb26cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_redisdb-0.2.1-py2.py3-none-any.whl

Download URL django_redisdb-0.2.1-py2.py3-none-any.whl
Size 7.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
96097c7ca39b3168ae52ed32c8c96c89d37e6718a356cf53345aff5932373092
BLAKE2b-256 checksum
How to use checksums
02c6cee8213e859d0eef88515565508dccb2ecc1ff99eb34fa9262aed53f82ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-redisdb 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page