8000 GitHub - cravler/flask-twisted: Simple integration of Flask and Twisted · GitHub
[go: up one dir, main page]

Skip to content

About

Simple integration of Flask and Twisted

Resources

Stars

18 stars

Watchers

4 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Flask-Twisted

Simple integration of Flask and Twisted

Installation

pip install Flask-Twisted

A Minimal Application

from flask import Flask
from flask.ext.twisted import Twisted

app = Flask(__name__)
twisted = Twisted(app)

...

if __name__ == "__main__":
    app.run()

Save it as app.py (or something similar) and run it with your Python interpreter.

python app.py

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

License

This software is under the MIT license. See the complete license in:

LICENSE

About

Simple integration of Flask and Twisted

Resources

Stars

18 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0