from wsgiref.simple_server import make_server
def new():
return 'new'
def RunServer(environ,start_response):
start_response('200 OK',[('Conten-Type','text/html')])
url = environ['PATH_INFO']
if url == '/new':
ret = new()
else:
ret = '404'
return ret
if __name__ == '__main__':
httpd = make_server('',8000,RunServer)
httpd.serve_forever()
Models 数据相关
Views 模版html文件
Controllers 业务逻辑
MVC-框架
Models 数据相关
Templates 模版html文件
Views 业务逻辑
MTV--框架