使用App Engine SDK在localhost中部署我的Google端点python应用程序时出错

时间:2023-01-24 00:16:38

I use the google cloud endpoints configuration as

我使用谷歌云端点配置

https://cloud.google.com/appengine/docs/python/endpoints/test_deploy

https://cloud.google.com/appengine/docs/python/endpoints/test_deploy

exactly, I run google chrome with flag

确切地说,我用旗帜运行google chrome

--user-data-dir=temp --unsafely-treat-insecure-origin-as-secure=http://localhost:8080

as

https://developers.google.com/explorer-help/#hitting_local_api

https://developers.google.com/explorer-help/#hitting_local_api

then, Google Chrome say me

然后,谷歌Chrome说我

You are using an unsupported command-line (--unsafely-treat-insecure-origin-as-secure) flag. Stability and security will suffer

您正在使用不受支持的命令行(--unsafely-treat-insecure-origin-as-secure)标志。稳定性和安全性将受到影响

If I visit

如果我访问

_http://localhost:8080/_ah/api/explorer

_http://本地主机:8080 / _ah / API /探险

then I get the error:

然后我得到错误:

The API you are exploring is hosted over HTTP, which can cause problems. Learn how to use Explorer with a local HTTP API .

您正在探索的API是通过HTTP托管的,这可能会导致问题。了解如何将Explorer与本地HTTP API配合使用。

I try to add --test-type flag as

我尝试添加--test-type标志为

_http://*.com/questions/32042187/chrome-error-you-are-using-an-unsupported-command-line-flag-ignore-certifcat

_http://*.com/questions/32042187/chrome-error-you-are-using-an-unsupported-command-line-flag-ignore-certifcat

then google chrome dont say anything, but when I visit

然后谷歌铬不说什么,但当我访问

_http://localhost:8080/_ah/api/explorer

_http://本地主机:8080 / _ah / API /探险

I get the same error.

我犯了同样的错误。

my app works fine in localhost except the endpoints part, and all works fine in appspot.com (endpoints too)

我的应用程序在localhost中工作正常,除了端点部分,并且所有工作在appspot.com上都很好(端点也是如此)

I use the last version of:

我用的是最后一个版本:

  • Python 2.7.11
  • Python 2.7.11
  • App Engine SDK 1.9.35
  • App Engine SDK 1.9.35
  • Google Chrome 49.0.2623.110
  • 谷歌浏览器49.0.2623.110

thank you and sorry for my english

谢谢你,对不起我的英语

3 个解决方案

#1


5  

  1. Click the shield button in Chrome's url bar.
  2. 点击Chrome网址栏中的盾牌按钮。

使用App Engine SDK在localhost中部署我的Google端点python应用程序时出错

  1. Click "Load unsafe scripts".
  2. 单击“加载不安全的脚本”。
  3. Click services (on the left bar) to reload the page.
  4. 单击服务(在左侧栏上)以重新加载页面。

#2


1  

I tried troubleshooting this issue when it first started happening for me. I quickly gave up and decided to just use another browser for the API explorer on localhost. IE 11 works for me. This isn't a great answer, but if you have other browsers installed, give them a try.

当我第一次开始发生这个问题时,我尝试对此问题进行排查。我很快就放弃了,决定在localhost上使用另一个浏览器来访问API资源管理器。 IE 11适合我。这不是一个好的答案,但如果您安装了其他浏览器,请尝试一下。

#3


0  

While Alex has the best answer, I'd just like to point out that this is only a problem with the API Explorer (which can definitely be handy).

虽然Alex有最好的答案,但我想指出这只是API Explorer的问题(绝对可以方便)。

But it doesn't affect direct calls to the API itself. So the URL below works fine without having to open a special sandbox chrome app or changing the script settings

但它不会影响对API本身的直接调用。因此,无需打开特殊的沙盒chrome应用程序或更改脚本设置,下面的URL工作正常

localhost:8080/_ah/api/greeting/v1/greetings/1

#1


5  

  1. Click the shield button in Chrome's url bar.
  2. 点击Chrome网址栏中的盾牌按钮。

使用App Engine SDK在localhost中部署我的Google端点python应用程序时出错

  1. Click "Load unsafe scripts".
  2. 单击“加载不安全的脚本”。
  3. Click services (on the left bar) to reload the page.
  4. 单击服务(在左侧栏上)以重新加载页面。

#2


1  

I tried troubleshooting this issue when it first started happening for me. I quickly gave up and decided to just use another browser for the API explorer on localhost. IE 11 works for me. This isn't a great answer, but if you have other browsers installed, give them a try.

当我第一次开始发生这个问题时,我尝试对此问题进行排查。我很快就放弃了,决定在localhost上使用另一个浏览器来访问API资源管理器。 IE 11适合我。这不是一个好的答案,但如果您安装了其他浏览器,请尝试一下。

#3


0  

While Alex has the best answer, I'd just like to point out that this is only a problem with the API Explorer (which can definitely be handy).

虽然Alex有最好的答案,但我想指出这只是API Explorer的问题(绝对可以方便)。

But it doesn't affect direct calls to the API itself. So the URL below works fine without having to open a special sandbox chrome app or changing the script settings

但它不会影响对API本身的直接调用。因此,无需打开特殊的沙盒chrome应用程序或更改脚本设置,下面的URL工作正常

localhost:8080/_ah/api/greeting/v1/greetings/1