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 >= 0.18
- redis >= 4.2
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"
# override default connection attempts, set < 0 to disable
# app.config["REDIS_CONN_ATTEMPTS"] = 3
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-2.0.0.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file quart-redis-2.0.0.tar.gz
.
File metadata
- Download URL: quart-redis-2.0.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5bf5d23da973e415a65e2b342242ebacb3734aeb61cde58bcce099dec66a1a9 |
|
MD5 | 96ddfb63671bafca5e7b35ed2e9b096a |
|
BLAKE2b-256 | 4ec7a68e4e7f5b375d4c24c05b8b2e266b720297d83dd85f6c2524aaa4cb8c42 |
File details
Details for the file quart_redis-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: quart_redis-2.0.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13fcd66245c20dc3c292245f5c3de8b7ecd1353ab64052883e9c051a39091de8 |
|
MD5 | 35e185e3e53c28908bcc025d2e5040e3 |
|
BLAKE2b-256 | 71aef5dac578068a6aad7a9489104fef8fe25258c2a22a6eec751c9b43503a89 |