Skip to content

cravler/flask-twisted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages