简体   繁体   English

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

[英]Error when I am deploying my google cloud endpoints python application in localhost with App Engine SDK

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. 您正在使用不受支持的命令行(--unsafely-treat-insecure-origin-as-secure)标志。 Stability and security will suffer 稳定性和安全性将受到影响

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. 您正在探索的API是通过HTTP托管的,这可能会导致问题。 Learn how to use Explorer with a local HTTP API . 了解如何将Explorer与本地HTTP API配合使用。

I try to add --test-type flag as 我尝试添加--test-type标志为

_http://stackoverflow.com/questions/32042187/chrome-error-you-are-using-an-unsupported-command-line-flag-ignore-certifcat _http://stackoverflow.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 谢谢你,对不起我的英语

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

Chrome Google Cloud Endpoints API Explorer:加载脚本

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

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. 我很快就放弃了,决定在localhost上使用另一个浏览器来访问API资源管理器。 IE 11 works for me. IE 11适合我。 This isn't a great answer, but if you have other browsers installed, give them a try. 这不是一个好的答案,但如果您安装了其他浏览器,请尝试一下。

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. 但它不会影响对API本身的直接调用。 So the URL below works fine without having to open a special sandbox chrome app or changing the script settings 因此,无需打开特殊的沙箱铬应用程序或更改脚本设置,下面的URL工作正常

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM