获取客户端IP地址
if 'HTTP_X_FORWARDED_FOR' in request.META:
ipaddress = request.META['HTTP_X_FORWARDED_FOR']
else:
ipaddress = request.META['REMOTE_ADDR']
if 'HTTP_X_FORWARDED_FOR' in request.META:
ipaddress = request.META['HTTP_X_FORWARDED_FOR']
else:
ipaddress = request.META['REMOTE_ADDR']
本文标题:Python获取客户端IP地址
本文链接:https://www.haomeiwen.com/subject/zfsdtctx.html
网友评论