Skip to content

Commit

Permalink
add throttling
Browse files Browse the repository at this point in the history
  • Loading branch information
MrArsenic621 committed Nov 28, 2024
1 parent d232a63 commit e848cf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
from .info_api import router as info_router
from ninja.errors import ValidationError,AuthenticationError
from .utils import api_response
from ninja.throttling import AnonRateThrottle, AuthRateThrottle

api = NinjaExtraAPI(title='PersianCCBooks',docs=Swagger())
api = NinjaExtraAPI(title='PersianCCBooks',docs=Swagger(),throttle=[
AnonRateThrottle('5/s'),
AuthRateThrottle('20/s'),
])

# jwt controler
api.register_controllers(NinjaJWTDefaultController)
Expand Down

0 comments on commit e848cf8

Please sign in to comment.