Home Software Consultant

Django Lessons - #2


I needed to record the IP address of the user as well as the admin for every action completed. And, this IP must show with each log entry. So, I used user_ip=request.META["REMOTE_ADDR"]). But, this did not work on the server. The IP was getting recorded as Why so? The information I got from the webfaction support was that

REMOTE_ADDR is because requests for your site are proxied through our front-end web server, which of course is on the local host.If you want the original IP of the request, then use request.META['HTTP_X_FORWARDED_FOR'].

I did some research, and found about the concept of reverse proxy. Some linksForumApache