码迷,mamicode.com
首页 > 移动开发 > 详细

install webapp2 on Linux outside google app engine.

时间:2015-05-11 12:36:37      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

Reference: https://webapp-improved.appspot.com/tutorials/quickstart.nogae.html

Step 1: install pip

Step 2:

$ pip install WebOb
$ pip install Paste
$ pip install webapp2

Step 3:

write a main.py

import webapp2

class HelloWebapp2(webapp2.RequestHandler):
    def get(self):
        self.response.write(Hello, webapp2!)

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

def main():
    from paste import httpserver
    httpserver.serve(app, host=127.0.0.1, port=8080)

if __name__ == __main__:
    main()

Step 4:

Run

$ python main.py

 

install webapp2 on Linux outside google app engine.

标签:

原文地址:http://www.cnblogs.com/miaoz/p/4493885.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!