mod_wsgi

配置:

mod_wsgi.load

 

WSGIScriptAlias /var/www/wsgi-scripts/simple.wsgi

def application(environ, start_response):  
    output = ‘hello world’
    status = ‘200 OK’
    headers = [(‘Content-type:’, ‘text/plain’),
               (‘Content-length’, str(len(status)))]
   start_respnse(status, headers)
   return [output]
从上面看出,其实对于一个WSGI应用来说,它其实也是一个服务器端的程序,负责返回状态码以及头部和内容。
posted @ 2015-03-09 13:13  leether  阅读(357)  评论(0编辑  收藏  举报