如何在自定义域上的googleappengine中获取主机名?

2024-04-30 02:22:44 发布

您现在位置:Python中文网/ 问答频道 /正文

在googleappengine/webapp2上,我使用self.request.host它在大多数情况下都可以工作,但偶尔不使用自定义域。在

http://%s % self.request.host  # sometimes returns ver.proj.appspot.com instead of mydomain.com

我找到了这个文档https://cloud.google.com/appengine/docs/standard/python/appidentity/#getting_the_application_hostname,但我并不总是想要默认版本,如果不是自定义域,我需要这个版本。在


Tags: self版本comhttphostrequest情况returns