django-ratelimit icon indicating copy to clipboard operation
django-ratelimit copied to clipboard

Annotate request and exception with usage data

Open cb109 opened this issue 1 year ago • 0 comments

This can e.g. be inspected by Django's exception handler to give an API user feedback about how long to wait until they may try again.

Usage data will be available as:

  • request.usage
  • <settings.RATELIMIT_EXCEPTION_CLASS>().usage

So inside my view or exception handler I could format time_left into a more helpful feedback text for the users of my API.

cb109 avatar Dec 20 '24 12:12 cb109