Python 我的heroku应用程序的IP地址是什么
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31932218/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what is the IP address of my heroku application
提问by Francis Chang
So in my django application, i'm running a task that will request from an api some data in the form of json.
所以在我的 django 应用程序中,我正在运行一个任务,它将以 json 的形式从 api 请求一些数据。
in order for me to get this data, i need to give the IP address of where the requests are going to come from (my heroku app)
为了让我获得这些数据,我需要提供请求来源的 IP 地址(我的 heroku 应用程序)
how do i get the ip address in which my heroku application will request at
我如何获得我的 heroku 应用程序将在其中请求的 IP 地址
回答by Casey
To my knowledge you can not get an ip for a heroku application. You could create a proxy with a known ip that serves as a middleman for the application. Otherwise you might want to look at whether heroku is still the correct solution for you
据我所知,您无法获得 heroku 应用程序的 ip。您可以创建一个具有已知 IP 的代理,作为应用程序的中间人。否则你可能想看看 heroku 是否仍然是你的正确解决方案
回答by abhishek77in
Heroku does not provide a static IP by itself but you can use addons to achieve this goal. This limitation is discussed here - https://devcenter.heroku.com/articles/apex-domains
Heroku 本身不提供静态 IP,但您可以使用插件来实现此目标。此处讨论了此限制 - https://devcenter.heroku.com/articles/apex-domains
Generally sites use URL instead of IP address to authenticate requests. You can use zerigo_dnsto get an static IP address for your Heroku app.
通常站点使用 URL 而不是 IP 地址来验证请求。您可以使用zerigo_dns为您的 Heroku 应用程序获取静态 IP 地址。