How to fix " AttributeError: 'DistributeHandler' object has no attribute 'group' "?

How to fix " AttributeError: 'DistributeHandler' object has no attribute 'group' "?

我关注了 Mr B运行o Rocha here 的视频来实现简单的 websocket,但是当我 运行 应用程序时,我得到以下异常:

AttributeError: 'DistributeHandler' 对象没有属性 'group'

控制器很简单:

@auth.requires_login()
def index():
    form = SQLFORM(Post, formstyle='divs')
    if form.process().accepted:
        websocket_send('http://127.0.0.1:8888', 'hello', 'mykey', 'mygroup')
    pass
    messages = db(Post).select(orderby=~Post.created_on)
    return dict(form=form, messages=messages)

在视图中,我执行以下操作以获取消息:

$(document).ready(function(){
   if(!$.web2py.web2py_websocket('ws://127.0.0.1:8888/realtime/mygroup', function(e){alert(e.data)}))

     alert("html5 websocket not supported by your browser, try Google Chrome");
});

当用户发送消息时,消息到达服务器(例如我可以看到它)但是当我重新加载页面时出现以下异常,error log,看起来问题发生在服务器发送时群里收到消息,有什么帮助吗??

原来这个问题是因为 tornado 框架的 3.2.1 版本,但是当我更新到最新版本 6.0.3 时,它就像一个魅力..