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)
Built Distribution
Close
Hashes for quart_redis-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a407747ac5610e2223abda94fe72b586705e9113a71dc8744129af73cd537ff7 |
|
MD5 | a77aa61e5e0a24763dc0774fb0c0f816 |
|
BLAKE2b-256 | 99c01aa3ae2802df6ecfdf10415743ad1befcd10fb4852b0403a39a6ed76b55a |