Sign in
There are a total of 2 posts.
Published 一月 26, 2026 by whitedec
DRF 範圍限制的兩種寫法:ScopedRateThrottle 與 UserRateThrottle 繼承比較
在 DRF 中實作範圍限制時,本文比較了兩種主流模式:ScopedRateThrottle 與 UserRateThrottle(或 SimpleRateThrottle)繼承。從實作位置、程式碼結構、擴充性與避免錯誤的角度,詳細說明何時…
DRF Throttling 完全攻略:設定、應用與自訂指南
本指南深入說明 DRF 的請求限制(Throttling)功能,從全域設定、視圖/動作級別、ScopedRateThrottle 以及自訂 Throttle 的實作,並提供 Redis Cache、代理環境 IP 取得、競爭條件與 429…