Get IP address in Google App Engine + Python

后端 未结 3 938
情歌与酒
情歌与酒 2020-12-25 12:18

I\'m looking for the equivalent of in Google App Engine and Python.

Thanks!

3条回答
  •  天涯浪人
    2020-12-25 12:28

    Try with:

    os.environ["REMOTE_ADDR"]
    

    or with the Request Class variable:

    class MyRequestHandler(webapp.RequestHandler):
        def get(self):
            ip = self.request.remote_addr
    

提交回复
热议问题