示例#1
0
文件: run.py 项目: 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)
示例#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()
示例#3
0
文件: wsgi.py 项目: lupks/lupskan
from app.main import app, socketio

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

示例#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)
示例#5
0
def run():
    socketio.run(app, port=5001)
示例#6
0
def run():
    init_db()
    socketio.run(app, host='0.0.0.0', port=5000, use_reloader=True)
示例#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)
示例#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)