简体   繁体   English

Google App Engine本地主机服务器错误python

[英]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.

相关问题 Google App Engine的Python代码出现服务器错误 - Server Error with Python code for Google App Engine 升级至Python 2.7 Google App Engine 500服务器错误 - Upgrading to Python 2.7 Google App Engine 500 server error 使用python的Google App Engine中的服务器内部错误 - Server Internal Error in google app engine using python 使用App Engine SDK在localhost中部署我的Google端点python应用程序时出错 - Error when I am deploying my google cloud endpoints python application in localhost with App Engine SDK Google App Engine服务器到服务器OAuth Python - Google App Engine Server to Server OAuth Python Google App Engine返回“错误:服务器错误” - Google App Engine returns 'Error: Server Error' Google App Engine Python 2.7启动器-Localhost显示空白页 - Google App Engine Python 2.7 Launcher - Localhost shows a blank page app.yaml /项目文件结构适用于app引擎localhost调试器,但不适用于谷歌应用引擎服务器 - app.yaml / project file structure works on app engine localhost debugger but not on google app engine server [Python] google app引擎将文件部署到服务器 - [Python ]google app engine deploying the file to server 在Google App Engine中部署python时出错 - Error while deploying python in Google App Engine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM