Skip to main content

Tastypie Redis Resource

Project description

Redis Resource for Tastypie

Allows you to create delicious APIs for Redis.

Settings

REDIS_HOST = localhost
REDIS_PORT = 6379
REDIS_DATABASE = "database_name"

Example of Usage

from tastypie import fields
from tastypie.authorization import Authorization

from tastypie_redis.resources import RedisResource, Document

class DocumentResource(RedisResource):
    id = fields.CharField(attribute="_id")
    title = fields.CharField(attribute="title", null=True)
    entities = fields.ListField(attribute="entities", null=True)

    class Meta:
        resource_name = "documents"
        list_allowed_methods = ["delete", "get", "post"]
        authorization = Authorization()
        object_class = Document
        collection = "documents" # collection name

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

tastypie-redis-resource-0.0.8.tar.gz (3.0 kB view hashes)

Uploaded Source

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