2017-10-28 134 views
0

我可以運行我的應用程序在本地使用 dev_appserver.py app.yamlApp Engine的Python的靈活的環境中選擇一個運行

我的應用程序的作品。但是,當我嘗試部署到應用程序引擎時,出現以下警告:警告:[runtime: python-compat]已棄用。請改用[runtime: python]。有關更多信息,請參閱https://cloud.google.com/appengine/docs/flexible/python/migrating。 我嘗試使用運行時:python,但是當我這樣做沒有什麼本地工作。另外,當我使用python-compat時,我無法部署到應用程序引擎,我只是得到Updating service [default]。我正在使用Python 2.7,我應該改變什麼來解決我的運行時問題?下面的app.yaml

runtime: python-compat 
env: flex 
entrypoint: gunicorn -b :$PORT main:app 


runtime_config: 
    python_version: 2 
threadsafe: true 

handlers: 
- url: /.* 
    script: main.app 

- url: /static 
    static_dir: static 

- url: .* 
    script: main.app 
+0

您運行的是哪個版本的SDK? –

+0

Google Cloud SDK [176.0.0] – ACrapProgrammer

回答

1

FWIW,通過dev_appserver.py本地運行的應用程序,你只是幸運能夠運行它(也許現在已經過時python-compat運行的,因爲?)只適用於標準的環境。從Using the Local Development Server

注:dev_appserver.py沒有在App Engine靈活的環境中運行。

對於您通常需要運行你的應用程序你會在GAE上運行同樣的方式,請參閱Running locally有關詳細信息,靈活的環境。在你的情況下,它會是:

gunicorn -b :$PORT main:app 

有鑑於此切換到runtime: python應該不再是一個問題,你只需與官方的建議一致。

備註:潛在利益:How to tell if a Google App Engine documentation page applies to the standard or the flexible environment

相關問題