install webapp2 on Linux outside google app engine.

时间:2023-03-09 21:28:51
install webapp2 on Linux outside google app engine.

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='') if __name__ == '__main__':
main()

Step 4:

Run

$ python main.py