AttributeError:'module'对象没有属性'ReuestHandler'

时间:2015-05-11 05:45:32

标签: python google-app-engine

我下载了Google App Engine Python SDK 1.9并遵循了Hello World教程。但总是我收到此错误:AttributeError: 'module' object has no attribute 'ReuestHandler'

webapp2无法导入,为什么?

这是我的app.yaml:

application: fproject
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: f.app


libraries:
- name: webapp2
  version: '2.5.1'

这是f.py

import webapp2


class MainPage(webapp2.ReuestHandler):
    def get(self):
        self.response.headers['Content-type'] = 'text/plain'
        self.response.write('Hello')

application = webapp2.WSGIApplication([
    ('/', MainPage),
    ], debug = True)



if __name__=='__main__':
    get()

1 个答案:

答案 0 :(得分:1)

RequestHandler

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

看看the newest tutorial,你似乎正在使用一个旧的(可能仍然有用,但这个更新鲜了:)。