Skip to content
New issue

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

Documentation for custom get_usage / is_rate_limited needed. #309

Open
colinkingswood opened this issue Nov 13, 2023 · 1 comment
Open

Comments

@colinkingswood
Copy link

I am looking to do some conditional rate limiting , and I see the documentation about customizing get_usage and is_ratelimited.
It' not clear how to use these methods after customization. Do you still call them using the decorator?
Are there any examples?

@jsocol
Copy link
Owner

jsocol commented Nov 21, 2023

Hey @colinkingswood, that's for the suggestion! Can I ask what you're trying to do with them?

These methods are kind of the "escape hatch" so that people can either wrap them in their own decorators, or use them within views—e.g. to add a CAPTCHA after a certain number of failed login attempts, without strictly blocking the request.

I'm very happy to accept additions to the Cookbook section of the docs, if there is some kind of how-to example we can write.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants