我正在尝试创建一个简单的Web应用程序,其中显示Hello Udacity并将其上传到Google App Engine,但我不断收到一堆错误。
来自Google App Engine的错误消息:
11:57 PM Host: appengine.google.com
Error parsing yaml file:
Unable to assign value 'udacityassignment2' to attribute 'url':
Value 'udacityassignment2' for url does not match expression '^(?:(?!\^)/.*|\..*|(\(.).*(?!\$).)$'
in "C:\Users\Wealthy\Desktop\ambhelloworld\udacityassignment2\app.yaml", line 12, column 8
2013-05-27 23:57:00 (Process exited with code 1)
You can close this window now.
app.yaml:
application: udacityassignment2
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: udacityassignment2
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
main.py:
import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello Udacity!')
app = webapp2.WSGIApplication([
('/', MainHandler)
], debug=True)
Google App Engine控制台:
Error: Not Found
The requested URL / was not found on this server.
有关如何纠正此问题的任何帮助将不胜感激。
答案 0 :(得分:4)
错误表明app.yaml中的url
条目无效。试试这个
url: /udacityassignment2
Tim指出,映射应该是
app = webapp2.WSGIApplication([
('/udacityassignment2', MainHandler)
], debug=True)
答案 1 :(得分:0)
您可以按照以下方式创建URL条目,以便在创建网址路由表时提供更大的灵活性
- url: .*
script: main.app