SyntaxFix
Write A Post
Hire A Developer
Questions
here is a short one liner to accomplish this:
request.META.get('HTTP_X_FORWARDED_FOR', request.META.get('REMOTE_ADDR', '')).split(',')[0].strip()