Middleware for ip / api based rate limiting for flask web services.
from middleware import Middleware
from ratelimitsetup import RateLimitSetup
# Sqlite Setup
RateLimitSetup()
# Hook ratelimit middleware
app.wsgi_app = Middleware(app.wsgi_app)
Configure the rate and the reset duration in .env
# Default Rate
DEFAULT_RATE=15
# Rate reset duration in seconds
DEFAULT_DURATION=30
With this configuration a user is able to make 15 requests every 30 seconds
This project is licensed under the MIT License - see the LICENSE.md file for details