运行时出现Google App Engine URL处理程序错误

时间:2016-03-01 06:12:16

标签: python google-app-engine flask yaml

这是我的app.yml文件

application: hello
version: 1
runtime: python27
api_version: 1
threadsafe: false
handlers:
- url: /.*
  script: hello.py

hello.py与app.yml文件位于同一目录。

当我运行应用程序时,我收到此错误:

google.appengine.api.yaml_errors.EventError: Unknown url handler type.
<URLMap 
    secure=default 
    static_files=None 
    application_readable=None 
    auth_fail_action=redirect 
    require_matching_file=None 
    static_dir=None 
    redirect_http_response_code=None 
    http_headers=None 
    url=/.* 
    script=None 
    upload=None 
    api_endpoint=None 
    expiration=None 
    position=None 
    login=optional 
    mime_type=None
    >
  in "C:\Users\***\Desktop\app\app.yaml", line 8, column 1
2016-03-01 11:36:12 (Process exited with code 1)

我认为这是间距是问题所以我在脚本之后添加了两个空格,但我仍然得到同样的错误。

1 个答案:

答案 0 :(得分:1)

您需要将app.yaml中处理程序的定义更改为:

application: hello
version: 1
runtime: python27
api_version: 1
threadsafe: false

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

密切关注script:财产。它应该指向您的WSGIApplication,上面的示例在app变量中定义。