Skip to main content

Redis support for Sanic framework

Project description

Redis support for Sanic framework


  • Based on the aioredis library
  • Easy to use and configurate for your own projects


This package should be installed using pip:

pip install sanic-redis-extension


from sanic import Sanic, response
from sanic_redis_ext import RedisExtension

app = Sanic(__name__)
# Configuration for Redis
    "REDIS_HOST": ""
    "REDIS_PORT": 6379
    "REDIS_SSL": None
RedisExtension(app) # Connection pool is available as `app.redis` or `app.extensions['redis']`

async def handle(request):
    with await as redis:
        await redis.set('test-my-key', 'value')
        val = await redis.get('test-my-key')
    return response.text(val.decode('utf-8'))


The sanic-redis-extension is published under BSD license. For more details read LICENSE file.

Project details

Download files

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

Files for sanic-redis-extension, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size sanic_redis_extension-0.1.1-py3-none-any.whl (2.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size sanic-redis-extension-0.1.1.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page