webpy安装

C:\Users\ceshi>python -m pip install web.py
Collecting web.py
Downloading web.py-0.38.tar.gz (91kB)
100%                                      92kB 61kB/s
Installing collected packages: web.py
Running setup.py install for web.py ... done
Successfully installed web.py-0.38

import web

urls = ("/(.*)","hello")

app = web.application(urls,globals())

class hello:

def GET(self,name):
if not name:
name = "World"
return "Hello, " + name + "!"
if __name__=="__main__":
app.run()

 

127.0.0.1:55329 - - [20/Sep/2017 13:11:51] "HTTP/1.1 GET /" - 405 Method Not Allowed

请求访求名写错GET写成Get

posted on 2017-09-20 13:03  sunny_2016  阅读(149)  评论(0编辑  收藏  举报

导航