Google App Engine | Python | app.yaml

I am new to Google App Engine, as well as web development in Python. Having made a small Python-based application, I tried over the past 6 days to load it into GAE. The file "app.yaml" below shows the error below.

APP.YAML (UPDATED)

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 

Google App Engine using Python 2.7.3 provides the following error

YAML ERROR WITH GAE

 *** 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 

If someone can kindly help me, I will be very grateful, especially on this day of American Thanksgiving !; -)


UPDATED

The file "app.yaml" was updated using the interval as suggested. But he still gives the same error.

I even tried it here, where it gives the same errors: Link > http://yaml-online-parser.appspot.com/

+6
source share
4 answers

When configuring app.yaml you need to separate all the parameters from their values ​​with spaces (therefore application:web2py should be application: web2py , etc.). Try to drop the space after the colons (especially after that: url:/(?P<a>.+?)/static/(?P<b>.+) ) And see if this fixes the error.

+1
source

This is a problem with your YAML syntax. If you are ever confused by the syntax, you can find the specification here. .

From section 2.1 - Collections:

YAMLs block collections use indentation for scope and begin each record on a separate line. Block sequences indicate each entry with a dash and a space ("-"). Mappings use a colon and a space (":") to denote each key: value pair. Comments begin with octotorp (also called "hash", "sharp", "pound" or "number sign" - "#").

+1
source

Try to remove all subsequent space after :
This worked for me, although app.yaml were some other errors in my app.yaml that I haven't fixed yet.

+1
source

I'm not sure what Google GAE uses to interpret the YAML file, but for PyYAML this file is not acceptable because of the \ value for static_files .

This is also the 9th line of the file (excluding empty lines). Therefore, I would start to avoid these meanings.

Please note that http://yaml-online-parser.appspot.com/ now just parses your exmaple, but it seems to convert \1 to '\ 2' before passing the data from the text field to PyYAML.

0
source

All Articles