flask-twisted
flask-twisted copied to clipboard
Some questions about flask-twisted.
Some questions about the code blow:
- flask.ext.twisted is deprecatd, use flask_twisted instead.
- why not provide a demo which can work well? The demo blow can not work.
- After
twisted = Twisted(app), we shoud usetwisted.run(host='0.0.0.0',port=13579, debug=False)(or like this) to run, rather than justapp.run()
from flask import Flask
from flask.ext.twisted import Twisted
app = Flask(__name__)
twisted = Twisted(app)
...
if __name__ == "__main__":
app.run()
- I can not run the code below successfully, and I do not know that does it mean and why it looks like this.
Twisted Daemon
from twisted.application.service import Application
from app import twisted
application = Application('twisted-flask')
twisted.run(run_reactor=False)
Save it as app.tac (or something similar) and run it with your Twistd program.
twistd -ny app.tac
Any reply will be appreciated.