11 lines
267 B
Python
11 lines
267 B
Python
|
from brake.backends import cachebe
|
||
|
|
||
|
|
||
|
class BrakeBackend(cachebe.CacheBackend):
|
||
|
def get_ip(self, request):
|
||
|
ip = request.META.get("HTTP_X_FORWARDED_FOR", request.META.get("REMOTE_ADDR"))
|
||
|
if ip:
|
||
|
ip = ip.split(", ")[-1]
|
||
|
return ip
|
||
|
|