from django.core import exceptions class RateLimitHit(exceptions.SuspiciousOperation): def __init__(self): self.text = "You made to many request in a short period of time! Please try again later" def __str__(self): return f"{self.__class__.__name__}: {self.text}" class ProxyUsageDetected(exceptions.SuspiciousOperation): def __init__(self): self.text = "It appears you are using a proxy! We don't want you to do that!" def __str__(self): return f"{self.__class__.__name__}: {self.text}"