Add a developer guide for Rate Limiting.

Review Request #14758 — Created Jan. 5, 2026 and updated

Information

Djblets
release-5.x

Reviewers

This adds a guide to the docs for using the new general rate limiting
support. It covers the new functions and best practices for constructing
rate limit keys.

Built the docs. Checked for any obvious errors, and for bad links and
build errors.

Summary ID
Add a developer guide for Rate Limiting.
This adds a guide to the docs for using the new general rate limiting support. It covers the new functions and best practices for constructing rate limit keys.
8a62dac0f10915ee2057af28fbf84c4e7ab1fa60
Description From Last Updated

Typo: let's -> lets

daviddavid

The arg names in the code are total_limit and period_secs

daviddavid

The default is to not increment. We should fix this paragraph and maybe also provide an example of check+increment.

daviddavid

Let's remove "by default" from this sentence.

daviddavid

We should import RateLimit in here too.

daviddavid

We mention get_user_id_or_ip in the above section, but we probably should include its usage here (and perhaps also in the …

daviddavid

Let's add the from djblets.auth.ratelimit import get_user_id_or_ip line to this example too.

daviddavid
david
  1. 
      
  2. Show all issues

    Typo: let's -> lets

  3. docs/djblets/guides/protect/ratelimit.rst (Diff revision 1)
     
     
     
     
     
    Show all issues

    The arg names in the code are total_limit and period_secs

  4. docs/djblets/guides/protect/ratelimit.rst (Diff revision 1)
     
     
     
    Show all issues

    The default is to not increment. We should fix this paragraph and maybe also provide an example of check+increment.

  5. Show all issues

    We should import RateLimit in here too.

  6. Show all issues

    We mention get_user_id_or_ip in the above section, but we probably should include its usage here (and perhaps also in the examples below)

  7. 
      
chipx86
Review request changed
Change Summary:

Fixed a number of issues with invoking the rate limit functions.

Commits:
Summary ID
Add a developer guide for Rate Limiting.
This adds a guide to the docs for using the new general rate limiting support. It covers the new functions and best practices for constructing rate limit keys.
ff3230519b7138d9a29263a812b01309d4a7a6ee
Add a developer guide for Rate Limiting.
This adds a guide to the docs for using the new general rate limiting support. It covers the new functions and best practices for constructing rate limit keys.
8a62dac0f10915ee2057af28fbf84c4e7ab1fa60

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. 
      
  2. docs/djblets/guides/protect/ratelimit.rst (Diff revisions 1 - 2)
     
     
    Show all issues

    Let's remove "by default" from this sentence.

  3. docs/djblets/guides/protect/ratelimit.rst (Diff revisions 1 - 2)
     
     
    Show all issues

    Let's add the from djblets.auth.ratelimit import get_user_id_or_ip line to this example too.

  4.