0

Google App Engine에서 hello world 프로그램을 실행하려했습니다. 그러나 브라우저에서 응용 프로그램을 실행하려고하면 500 개의 서버 오류가 발생합니다. GAE app 엔진 실행기와 Python 2.7.5를 다시 설치하려고했습니다. 그러나 운이 없다! 여기 Google 앱 엔진 localhost 서버 오류 python

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) 

애플리케이션 제목입니다

application: silent-blend-359 
version: 1 
runtime: python27 
api_version: 1 
threadsafe: true 

handlers: 
- url: /.* 
    script: hello.application 

로그 큰하는 것입니다 그래서 내가 여기 http://paste.ubuntu.com/6195427/

를 붙여

해결

인터넷에 연결하기 위해 프록시를 사용하고있었습니다. 그냥 프록시를 비활성화하고 짜잔! 문제 해결됨!

+0

당신은 지금 벚꽃 평을 실행하고 있습니까? 어쩌면 그것은 항구를 잡을 것입니다. –

답변

1

Indendation은 Python 구문의 일부입니다. 제대로 들여 쓰기 :

class MainPage(webapp2.RequestHandler): 
    def get(self): 
     self.response.headers['Content-Type'] = 'text/plain' 
     self.response.write('Hello, World!') 

그리고, app.yaml 라인 다음 대체 (가 hello.py에는 application 없지만 app) :

hello.application 

로 :

hello.app 

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) 

애플리케이션 제목을

application: silent-blend-359 
version: 1 
runtime: python27 
api_version: 1 
threadsafe: true 

handlers: 
- url: /.* 
    script: hello.app 
+0

그것은 붙여 넣기 오류입니다. 들여 쓰기를 확인했습니다. 맞아요. –

+0

@anik_das, 알 수 있습니다. 나는 대답을 업데이트했다. – falsetru

+0

그랬어. 아직도 운이 없다. –