Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Annotate request and exception with usage data #324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cb109
Copy link

@cb109 cb109 commented Dec 20, 2024

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.

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.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant