import web
urls=(
"/",'index',
)
app=web.application(urls,globals())
def notfound():
return web.notfound("my not found page")
app.notfound=notfound
class index:
def GET(self):
return "normal index"
if __name__=="__main__":
app.run()
运行服务器,浏览器输入http://127.0.0.1:8080/+任意非空字符,返回的即为自定义Notfound