获取客户端IP地址
if 'HTTP_X_FORWARDED_FOR' in request.META:
ipaddress = request.META['HTTP_X_FORWARDED_FOR']
else:
ipaddress = request.META['REMOTE_ADDR']
转载于:https://blog.51cto.com/14284354/2401482
if 'HTTP_X_FORWARDED_FOR' in request.META:
ipaddress = request.META['HTTP_X_FORWARDED_FOR']
else:
ipaddress = request.META['REMOTE_ADDR']
转载于:https://blog.51cto.com/14284354/2401482