Now, we will configure throttling policies for the class-based views related to drones: DroneList and DroneDetail. We will override the values for the following class attributes for the class-based views:
- throttle_classes: This class attribute specifies a tuple with the names of the classes that will manage throttling rules for the class. In this case, we will specify the ScopedRateThrottle class as the only member of the tuple.
- throttle_scope: This class attribute specifies the throttle scope name that the ScopedRateThrottle class will use to accumulate the number of requests and limit the rate of requests.
This way, we will make these class-based views work with the ScopedRateThrottle class and we will configure the throttle scope that this class will consider for each of the class based views related to drones.
...