python - 谷歌应用服务器 "unable to add testProject to attribute application"正则表达式问题中的 yaml 异常?

标签 python google-app-engine yaml

使用 Google App Engine 的第一天。

我的 yaml 文件包含以下内容:

application: testProgram
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
  script: main.py

libraries:
- name: webapp2
  version: "2.5.2"

我的 python 文件包含以下内容(只是为了咯咯笑):

import webapp2


class MainPage(webapp2.RequestHandler):
    def get(self):
        self.reponse.headers['Content-Type'] = 'text/plain'
        self.response.out.write("Hurray for cake!")


app = webapp2.WSGIApplication([('/', MainPage)],debug=True)

我得到的错误如下:

ile "/home/rickus/google_appengine/google/appengine/api/yaml_listener.py", line 178, in _HandleEvents
    raise yaml_errors.EventError(e, event_object)
google.appengine.api.yaml_errors.EventError: Unable to assign value 'testProgram' to attribute 'application':
Value 'testProgram' for application does not match expression '^(?:(?:[a-z\d\-]{1,100}\~)?(?:(?!\-)[a-z\d\-\.]{1,100}:)?(?!-)[a-z\d\-]{0,99}[a-z\d])$'
  in "testProgram/app.yaml", line 1, column 14

所以它是在提示我的文件命名?这不可能吧?我有什么想法吗?

最佳答案

这很可能是在提示你的 applicationId,看看正则表达式,它只接受小写字符。

将您的 applicationId 更改为“testprogram”或​​“test-program”

关于python - 谷歌应用服务器 "unable to add testProject to attribute application"正则表达式问题中的 yaml 异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39263309/

相关文章:

python - 使用 mandrill 和 django 进行电子邮件转发和跟踪

Python - 阅读时忽略每行的第一个字符(制表符)

python - python中创建不可初始化但其子类可初始化的类的最佳方法

node.js - 在 package.json 中使用私有(private) git 存储库部署 Google App Engine

python - 云存储 : how to setup service account credentials for python boto library

python - 如何通过 HTTP 响应从 Google App Engine 上的 Python 数据存储中检索数据

java - 同步 Android sqlite 数据库和 GAE 数据存储

c# - 每个选择具有多个值的 LINQ 构建数组

python - 加载 yaml 字符串时跳过转换实体(使用 PyYAML)

python - 软件包未通过 elastic beanstalk config.yml 安装