Example #1
0
File: run.py Project: foggsz/luck
from gevent import monkey
monkey.patch_all()
from app.main import app, socketio
# from  eventlet import monkey_patch
# import redis
# gevent.monkey.patch_all()
if __name__ == "__main__":
    socketio.run(app, port=8000, debug=True)
Example #2
0
# 主页
@app.route('/home')
@login_required
def home():
    return render_template("layout/home.html", async_mode=socketio.async_mode)


# 退出
@app.route('/logout')
@login_required
def logout():
    session.pop('username', None)
    logout_user()  # 登出用户
    return redirect(url_for('login'))


manager.add_command("shell", Shell(make_context=make_shell_context))
manager.add_command('db', MigrateCommand)
# 新加入的代码,重写manager的run命令
manager.add_command(
    'runserver',
    socketio.run(app=app,
                 host='0.0.0.0',
                 port=5000,
                 use_reloader=False,
                 debug=True))

if __name__ == '__main__':
    manager.run()
Example #3
0
from app.main import app, socketio

if __name__ == "__main__":
    socketio.run(app, debug=True)

Example #4
0
#!/bin/env python
from flask_socketio import SocketIO

from app.main import app, socketio

if __name__ == '__main__':
    # Setting debug=True enables the werkzeug debugger
    socketio.run(app, host='0.0.0.0', use_reloader=True, debug=True)
Example #5
0
def run():
    socketio.run(app, port=5001)
Example #6
0
def run():
    init_db()
    socketio.run(app, host='0.0.0.0', port=5000, use_reloader=True)
Example #7
0
from app.main import app, socketio
from app import config
import eventlet

if __name__ == '__main__':
    debug = False
    if hasattr(config, 'debug'):
        if config.debug == True:
            debug = True
    socketio.run(app, debug=debug)
Example #8
0
from flask_socketio import SocketIO

from app.main import app as application, socketio

# Used to serve application with gunicorn
if __name__ == "__main__":
    socketio.run(application)