I am currently working on another project and it requires me to find the location of users who are accessing my site. After some research, I found that there is a Google’s public API that tracks the location of a user: X- AppEngine
X-AppEngine finds the location of a user using the IP address from HTTP header information. You can simply assign a variable to the below code.
self.request.headers.get('X-AppEngine-City')
It works like a charm. Without this, I would have had to find the IP address of a user using
self.request.remote_addr
then use one of the public APIs that converts the IP address into coordinates.