Ali-Akber Saifee

Results 88 comments of Ali-Akber Saifee

> So If I want to make it reset every month let's say, how to achieve that? You could call the reset method on the storage if it supports it...

Yes, you can achieve this by using a custom `request_identifier` ([reference](https://flask-limiter.readthedocs.io/en/stable/api.html#flask_limiter.Limiter.params.request_identifier)) function that includes the variables in the identifier. By default the identity of the request is derived from `request.endpoint`...

Something like this: ```python from flask import Flask, request from flask_limiter import Limiter from flask_limiter.util import get_remote_address app = Flask(__name__) def idfunc(): return request.path limiter = Limiter( get_remote_address, app=app, default_limits=["1...

You could use the `on_breach` hook as documented [here](https://flask-limiter.readthedocs.io/en/latest/api.html#flask_limiter.Limiter.params.on_breach)

I think the global application limits ([reference](https://flask-limiter.readthedocs.io/en/stable/configuration.html#RATELIMIT_APPLICATION)) is what your looking for