复制代码 代码如下:
#!/usr/bin/env python
import web
urls = (
'/hello', 'hello', '/hello/(.*)$', 'hello'
)
app = web.application(urls, globals())
class hello:
def GET(self, name=None):
if not name:
name = 'world'
return 'Hello, ' + name + '!'
if __name__ == "__main__":
app.run()
复制代码 代码如下:
server.modules += ( "mod_fastcgi" )
fastcgi.server = ("/hello" =>
((
"bin-path" => "/var/www/hello.py",
"socket" => "/tmp/hello.py.socket",
"max-procs" => 1,
"bin-environment" => (
"REAL_SCRIPT_NAME" => ""
),
"check-local" => "disable"
))
)
新闻热点
疑难解答
图片精选