Google App Engine错误(请求的URL /在此服务器上找不到) [英] Google App Engine Error (The requested URL / was not found on this server)

查看:228
本文介绍了Google App Engine错误(请求的URL /在此服务器上找不到)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个简单的Web应用程序,指出Hello Udacity并将其上传到Google App Engine,但是我一直在收到一些错误。

来自Google App Engine的错误消息:

  11:57 PM主持人:appengine.google.com 
解析yaml文件时出错:
无法将值'udacityassignment2'分配给'url'属性:
url的值'udacityassignment2'与表达式不匹配'^(?:( ?! \ ^) /.*|\..*|(\(.).*(?!\$).)$'
inC:\Users\Wealthy\Desktop\ambhelloworld\\ \\udacityassignment2\app.yaml,第12行,第8列
2013-05-27 23:57:00(程序退出时带有代码1)

您现在可以关闭此窗口。

app.yaml:

 应用程序:udacityassignment2 
版本:1
运行时:python27
api_version:1
线程安全:是

处理程序:
- url:/ favicon \。 ico
static_files:favicon.ico
上传:favicon\.ico

- url:udacityassignment2
脚本:main.app

库:
- name:webapp2
version:2.5.2

main.py:

  import webapp2 
$ b $ class MainHandler(webapp2。 RequestHandler):
def get(self):
self.response.write('Hello Udacity!')

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

Google App Engine

 错误:未找到
在此服务器上找不到请求的URL。

有关如何解决此问题的任何帮助,我们将不胜感激。


<该错误表明您的app.yaml中的 url 条目无效。解决方案

试试这个

  url:/ udacityassignment2 

正如Tim指出的那样,映射应该是 $ b

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


I am trying to create a simple web application that says Hello Udacity and upload it to Google App Engine, but I keep on getting a bunch of errors.

Error message from 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 console:

Error: Not Found
The requested URL / was not found on this server.

Any assistance on how to correct this issue would be appreciated.

解决方案

The error is indicating that the url entry in your app.yaml is not valid. Try this

url: /udacityassignment2

And as Tim pointed, the mapping should be

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

这篇关于Google App Engine错误(请求的URL /在此服务器上找不到)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆