I have an API and would like to check that I only process requests from certain hosts, 开发者_JAVA技巧using self.request.host always brings back the current API host, not the requesting URL's host...any ideas?
Thanks
The Request object has a property called remote_addr that should give you IP address of the origin of the request. See the docs.
Do you mean referer?
self.request.headers.get("Referer")
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论