Skip to main content

A easy way of setting up a redis in quart

Project description

Quart-Redis

A easy way of setting up a redis connection in quart.

Requirements

  • quart
  • aioredis

Example of Use

from quart import Quart
from quart_redis import RedisHandler, get_redis

app = Quart(__name__)
app.config["REDIS_URI"] = "redis://localhost"
redis_handler = RedisHandler(app)

@app.route("/")
async def index():
    redis = get_redis()

    val = await redis.get("my-key", encoding="utf-8")

    if val is None:
        await redis.set("my-key", "it works!")

    return val

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

quart-redis-0.1.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

quart_redis-0.1.0-py3-none-any.whl (3.1 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