Nik*_*ntz 10 python google-app-engine yaml python-2.7
我正在将我的gae应用程序迁移到python 2.7.这是我的新app.yaml:
application: webfaze
version: main
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /mapreduce(/.*)?
script: mapreduce/main.application
- url: /(.*\.(html|css|js|gif|jpg|png|ico|swf))
static_files: static/\1
upload: static/.*
expiration: "1d"
- url: .*
script: main.application
- url: /task/.*
script: main.application
login: admin
Run Code Online (Sandbox Code Playgroud)
但我收到此错误消息:
Error parsing yaml file:
Invalid object:
threadsafe cannot be enabled with CGI handler: mapreduce/main.application
in "webfaze/app.yaml", line 22, column 1
Run Code Online (Sandbox Code Playgroud)
你能告诉我如何解决这个错误吗?
检查源代码,看起来您需要定义处理程序的路径而不带任何斜杠:
if (handler.script and (handler.script.endswith('.py') or
'/' in handler.script)):
raise appinfo_errors.ThreadsafeWithCgiHandler(
'threadsafe cannot be enabled with CGI handler: %s' %
handler.script)
Run Code Online (Sandbox Code Playgroud)
移动application.py
到项目的根目录并相应地修改处理程序的路径.
更改:
- url: /mapreduce(/.*)?
script: mapreduce/main.application
Run Code Online (Sandbox Code Playgroud)
至:
- url: /mapreduce(/.*)?
script: mapreduce.main.application
Run Code Online (Sandbox Code Playgroud)
您可能还需要在'mapreduce'文件夹中添加__init__ .py(如果已经存在的话).这将使python将文件夹解释为模块.
归档时间: |
|
查看次数: |
3736 次 |
最近记录: |