from flask import Flask, render_template, g app = Flask(__name__) @app.route("/") def index(): return render_template("index.html") # run in under twisted through wsgi from twisted.web.wsgi import WSGIResource from twisted.web.server import Site resource = WSGIResource(reactor, reactor.getThreadPool(), app) site = Site(resource)
原文:http://www.cnblogs.com/bergus/p/4592657.html