mirror of
https://github.com/makeplane/plane.git
synced 2026-07-11 21:10:13 +02:00
8 lines
227 B
Python
8 lines
227 B
Python
def get_client_ip(request):
|
|
x_forwarded_for = request.META.get("HTTP_X_FORWARDED_FOR")
|
|
if x_forwarded_for:
|
|
ip = x_forwarded_for.split(",")[0]
|
|
else:
|
|
ip = request.META.get("REMOTE_ADDR")
|
|
return ip
|