Forums

How to get real IP of the user on PythonAnywhere

How can I get IP address of the current user in Django?

I've tried request.META.get('X-Real-IP') as you suggested in your docs, but it returns None.

I think I got it.

request.META.get('HTTP_X_REAL_IP')

Thanks! I've updated the docs to reflect the different code for Django.