Google App Engine | Python | 的app.yaml

PRA*_*RIA 6 python google-app-engine yaml development-environment app.yaml

我是Google App Engine的初学者,也是Python的Web开发人员.在制作了一个基于Python的小应用程序后,我一直在尝试过去6天将其上传到GAE上.下面的"app.yaml"文件给出了之后给出的错误.

APP.YAML(更新)

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

default_expiration: "24h"

handlers: 
- url: /(?P<a>.+?)/static/(?P<b>.+)
  static_files: applications/\1/static/\2
  upload: applications/(.+?)/static/(.+)
  secure: optional

- url: /favicon.ico
  static_files: applications/welcome/static/favicon.ico
  upload: applications/welcome/static/favicon.ico

- url: /robots.txt
  static_files: applications/welcome/static/robots.txt
  upload: applications/welcome/static/robots.txt

- url: .*
#  script: gaehandler.py         # CGI
#  script: web2py.app # ?
  script: gaehandler.wsgiapp    # WSGI (Python 2.7 only)
  secure: optional

admin_console:
  pages:
  - name: Appstats
    url: /_ah/stats

skip_files: |
 ^(.*/)?(
 (app\.yaml)|
 (app\.yml)|
 (index\.yaml)|
 (index\.yml)|
 (#.*#)|
 (.*~)|
 (.*\.py[co])|
 (.*/RCS/.*)|
 (\..*)|
 (applications/(admin|examples)/.*)|
 ((admin|examples)\.(w2p|tar))|
 (applications/.*?/(cron|databases|errors|cache|sessions)/.*)|
 ((logs|scripts)/.*)|
 (anyserver\.py)|
 (web2py\.py)|
 ((cgi|fcgi|modpython|wsgi)handler\.py)|
 (epydoc\.(conf|css))|
 (httpserver\.log)|
 (logging\.example\.conf)|
 (route[rs]\.example\.py)|
 (setup_(app|exe)\.py)|
 (splashlogo\.gif)|
 (parameters_\d+\.py)|
 (options_std.py)|
 (gluon/tests/.*)|
 (gluon/(rocket|winservice)\.py)|
 (contrib/(gateways|markdown|memcache|pymysql)/.*)|
 (contrib/(populate|taskbar_widget)\.py)|
 (google_appengine/.*)|
 (.*\.(bak|orig))|
 )$

builtins:
- remote_api: on
- appstats: on
- admin_redirect: on
- deferred: on
Run Code Online (Sandbox Code Playgroud)

使用Python 2.7.3时,Google App Engine会出现以下错误

GAE上的YAML ERROR

*** Running dev_appserver with the following flags:
    --admin_console_server= --port=8080 --use_sqlite
Python command: /usr/local/bin/python2.7
ERROR    2012-11-22 05:24:13,142 dev_appserver_main.py:626] Fatal error when loading application configuration:
mapping values are not allowed here
  in "/Applications/+++WWW+++/GAE/gae3web2py/app.yaml", line 9, column 9
Run Code Online (Sandbox Code Playgroud)

如果有人能帮助我,我会非常感激,尤其是在美国"感恩节"的这一天!;-)


更新

使用建议的间距更新"app.yaml"文件.但它仍然会给出同样的错误.

我甚至在这里尝试了它,它给出了同样的错误: 链接 > http://yaml-online-parser.appspot.com/

Roc*_*key 1

配置 时app.yaml,您需要用空格将所有参数与其值分开(也application:web2py应该application: web2py如此)。尝试在冒号后面添加一个空格(特别是在这个: 后面url:/(?P<a>.+?)/static/(?P<b>.+)),看看是否可以修复错误。