We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have you considered adding a rate limiter? I have made good experiences with: https://pypi.org/project/fastapi-limiter/
In this case,
from fastapi_limiter import FastAPILimiter from fastapi_limiter.depends import RateLimiter @app.on_event("startup") async def startup(): redis = redis.from_url("redis://localhost", encoding="utf-8", decode_responses=True) await FastAPILimiter.init(redis)
and
app = FastAPI(dependencies=[RateLimiter(times=2, seconds=5))])
. If you want, might also be added as optional, or if redis is offline:
# for forward compatability: if os.environ.get("RATE_LIMIT", False): ...
The text was updated successfully, but these errors were encountered:
It looks great. fastapi-limiter is a nice library, but it requires Redis . Perhaps https://github.com/laurentS/slowapi is also a good alternative?
Redis
Sorry, something went wrong.
Also a great choice, seems to have redis support and support for local filesystem.
🎉🎉 In version v0.5.0, the rate limit functionality has been implemented. Thank you for your suggestion.
No branches or pull requests
Have you considered adding a rate limiter? I have made good experiences with:
https://pypi.org/project/fastapi-limiter/
In this case,
and
. If you want, might also be added as optional, or if redis is offline:
The text was updated successfully, but these errors were encountered: