Exemplo n.º 1
0
def db_create():
    """Create database"""
    try:
        db.create_all()

    except OperationalError:
        raise UserWarning('It looks like your MySQL server hasn\'t been started yet.')
Exemplo n.º 2
0
def db_create():
    """Create database"""
    try:
        db.create_all()

    except OperationalError:
        raise UserWarning(
            'It looks like your MySQL server hasn\'t been started yet.')
Exemplo n.º 3
0
def run(app, with_tornado=False):
    from tornado.wsgi import WSGIContainer
    from tornado.httpserver import HTTPServer
    from tornado.ioloop import IOLoop

    # create database
    db.create_all()
    print('[OK] Database creation complete.')

    if with_tornado:
        http_server = HTTPServer(WSGIContainer(app))
        http_server.listen(config['port'])
        IOLoop.instance().start()
    else:
        app.run(host='0.0.0.0', port=config['port'], debug=config['debug'])
Exemplo n.º 4
0
def run(app, with_tornado=False):
    from tornado.wsgi import WSGIContainer
    from tornado.httpserver import HTTPServer
    from tornado.ioloop import IOLoop

    # create database
    db.create_all()
    print('[OK] Database creation complete.')

    if with_tornado:
        http_server = HTTPServer(WSGIContainer(app))
        http_server.listen(config['port'])
        IOLoop.instance().start()
    else:
        app.run(host='0.0.0.0', port=config['port'], debug=config['debug'])