[英]Google app engine localhost server error python
I was just trying to run the hello world program in google app engine. 我只是想在Google App Engine中运行Hello World程序。 But when I try to run the application on my browser I get a 500 server error.
但是,当我尝试在浏览器上运行该应用程序时,出现500服务器错误。 I tried re-installing both GAE app engine launcher and python 2.7.5.
我尝试重新安装GAE应用引擎启动器和python 2.7.5。 But no luck!
但是没有运气!
here is my hello.py 这是我的hello.py
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, World!')
app = webapp2.WSGIApplication([
('/', MainPage),
], debug=True)
app.yaml 的app.yaml
application: silent-blend-359
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: hello.application
the log is to big so i pasted it here http://paste.ubuntu.com/6195427/ 日志很大,所以我在这里粘贴了它http://paste.ubuntu.com/6195427/
SOLVED 解决了
I was using a proxy to connect to the internet. 我正在使用代理连接到互联网。 Just disabled the proxy and voila!
刚刚禁用代理和瞧! Problem solved!
问题解决了!
Indendation is part of Python syntax. 引言是Python语法的一部分。 Indent correctly:
正确缩进:
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, World!')
And, replace following line in app.yaml
(There's no application
in hello.py
, but app
): 并且,替换
app.yaml
以下行( hello.py
没有application
,但是app
):
hello.application
with: 有:
hello.app
hello.py hello.py
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, World!')
app = webapp2.WSGIApplication([
('/', MainPage),
], debug=True)
app.yaml 的app.yaml
application: silent-blend-359
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: hello.app
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.