Source

pyconjp2011 / fanstatic_demo.py

Full commit
from fanstatic import Fanstatic
from js.jqueryui import jqueryui
from webob import Response
from webob.dec import wsgify

body = """\
<html>
<head>
</head>
<body>
Hello
</body>
</html>
"""
@wsgify
def app(request):
    jqueryui.need()
    return Response(body)

app = Fanstatic(app)

from wsgiref import simple_server

httpd = simple_server.make_server('', 8081, app)
httpd.serve_forever()