声明:
本博客欢迎转发,但请保留原作者信息!
新浪微博:@孔令贤HW;
博客地址:http://blog.csdn.net/lynn_kong
本博客欢迎转发,但请保留原作者信息!
新浪微博:@孔令贤HW;
博客地址:http://blog.csdn.net/lynn_kong
内容系本人学习、研究和总结,如有雷同,实属荣幸!
1. 一个简单的WSGI程序
"""Hello World using WSGI """
from paste import httpserver
def application(environ, start_response):
start_response('200 OK', [('Content-type', 'text/html')])
return ['Hello World']
httpserver.serve(application, host='127.0.0.1', port=8080)
这个不用过多解释,wsgi的入门程序。在本机用cURL工具可以进行测试。
2. WSGI With WebOb + Paste
"""Hello World using WebOb, Paste + WSGI """
from webob import Response
from webob.dec import wsgify
from webob import exc
from paste import ht