Пример #1
0
def app(request):
    """app fixture."""
    app = create_app(environment='Testing')
    cnt = app.app_context()
    cnt.push()

    def teardown():
        cnt.pop()

    request.addfinalizer(teardown)

    return app
Пример #2
0
import sys

reload(sys)
sys.setdefaultencoding('utf-8')
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from bbs import db, create_app
from geventwebsocket.websocket import WebSocket, WebSocketError
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer

app = create_app()

migrate = Migrate(app, db)

manager = Manager(app)
manager.add_command('db', MigrateCommand)

if __name__ == '__main__':
    #manager.run()
    http_serve = WSGIServer(("0.0.0.0", 5000),
                            app,
                            handler_class=WebSocketHandler)
    http_serve.serve_forever()
Пример #3
0
# coding:utf-8

from bbs import create_app, db
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

# 创建flask的应用对象
app = create_app("develop")

manager = Manager(app)
Migrate(app, db)
manager.add_command("db", MigrateCommand)

if __name__ == '__main__':
    manager.run()
Пример #4
0
import bbs


app = bbs.create_app()
app.run(host="0.0.0.0", port=6677, debug=True,threaded=True)