1👍
The simplest way is with:
request.META.get('REMOTE_ADDR')
If your app server is behind a proxy, see this more advanced solution (using the HTTP_X_FORWARDED_FOR
you mentioned):
0👍
You should have to use django-ipware for get correct IP. This django app will give you 99% correct result. I am using this app and i am always getting correct result.
Note: I have given 99% success rating a per my previous working experience.
- [Answer]-How can I save an empty model (I only need it's pk created)
- [Answer]-JS Change form action upon select change doesn't work with .trim()
Source:stackexchange.com