Store and retrieve data in a consistent way in a key-value store using Django Rest Framework serializers
Project description
drf-keyvalue
Store and retrieve data in a consistent way in a key-value store using Django Rest Framework serializers
About
Supported backends
- Redis
Installation
pip install drf-keyvalue
Setup
**Add to settings.py **
INSTALLED_APPS = [
'drf_keyvalue',
]
Usage
For detailed usage, see the tests
from drf_keyvalue.keyvalue import get_client
from .models import Todo, TodoSerializer
import redis
redis.StrictRedis(host='localhost', port=6379, db=0)
client = get_client('keyvalue.backends.RedisBackend', connection)
todo = Todo.objects.first()
client.set(TodoSerializer, todo)
client.get(todo)
client.delete(todo)
Backend specifics:
RedisBackend
import redis
connection = redis.StrictRedis(host='localhost', port=6379, db=0)
redis_client = get_client('drf_keyvalue.backends.RedisBackend', connection=connection)
Development
Updating pypi repo:
bumpversion patch # major, minor or patch
#push to gitlab:
git push origin master
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
drf-keyvalue-0.0.3.tar.gz
(2.6 kB
view hashes)