A easy way of setting up a redis in quart
Project description
Quart-Redis
An easy way of setting up a redis connection in quart.
Requirements
- quart
- aioredis
Example of Use
pip install quart-redis
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")
if val is None:
await redis.set("my-key", "it works!")
val = await redis.get("my-key")
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-1.0.0.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for quart_redis-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab029f9146336457a3f997adaa133e77ca222ffc3903b32a58d43972fdc58f5c |
|
MD5 | 8b6cd651f6aba9daf7e526e048d911cc |
|
BLAKE2b-256 | 3c2914e373a8e2a16f35afb3ab40bf79997b27ae9f929183333f067403210ac5 |