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.1.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for quart_redis-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27eb585048f39a1e759d3453a88fa568dffcd1bd814fc753e96ef5c1e422fd9c |
|
MD5 | 0b67fa36d585a9932591208eff98ba50 |
|
BLAKE2b-256 | 98b21e26119651599be95d484e75fdd34ae74ea2222a44c9ad6bae5aec23e0fe |