Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 运行时出现Google应用程序引擎URL处理程序错误_Python_Google App Engine_Flask_Yaml - Fatal编程技术网

Python 运行时出现Google应用程序引擎URL处理程序错误

Python 运行时出现Google应用程序引擎URL处理程序错误,python,google-app-engine,flask,yaml,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.

这是我的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)
google.appengine.api.yaml_errors.EventError:未知的url处理程序类型。
在“C:\Users\***\Desktop\app\app.yaml”第8行第1列中
2016-03-01 11:36:12(流程退出,代码为1)

我认为是间距问题,所以我在脚本后添加了两个空格,但仍然出现相同的错误。

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

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

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

请密切注意
脚本:
属性。它应该指向您的
WSGIApplication
,在上面的示例中,它是在
app
变量中定义的。

我怀疑投诉是关于
hello.py
.py
后缀的,您不是指
hello.app
(这将需要包含应用程序代码的相应
hello.py
文件)?