django - 如何使用 channel websocket 在 Django 中找到 websocketbridge.js?

标签 django python-3.x websocket redis channel

我正在尝试使用 Django 项目中的 channel 来实现 websockets。我收到 webscoketbridge.js 的 404 下面是 html 模板。 {% 加载静态文件 %} {% block title %}交付{% endblock %}

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link href='https://fonts.googleapis.com/css?family=Satisfy' rel='stylesheet' type='text/css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="{% static 'channels/js/websocketbridge.js' %}" type="text/javascript"></script>

enter image description here

enter image description here

另外,我尝试查看 virtualenv/lib/python3.5/site-packages/channels 路径,没有 js 文件夹或任何名为 websocketbridge.js 的文件

有人解决这个问题了吗?

最佳答案

JavaScript 桥在 v2.1.4 中被删除。这是提交:https://github.com/django/channels/commit/2a9d764ad03927581aa2bfcadccc3e953949cb98#diff-b582cbb2f8294afa8bbe26c4c360a01d

这让我很恼火,在我的书中,这打破了语义版本控制。

关于django - 如何使用 channel websocket 在 Django 中找到 websocketbridge.js?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53468845/

相关文章:

Python3 Django -> HTML 到 PDF

Django Factory Boy 创建 vs create_batch

python - 如何在Python中使用正则表达式删除字母并提取数字?

python - 查找两个多维列表之间的差异

erlang - 如何在牛仔服务器中手动关闭 websocket 连接?

django - 如何迁移django自定义base64字段。栏位不存在

python - 在 Django/Algorithm 中复制模型实例及其相关对象以递归地复制对象

python - 有没有办法将默认参数设置为等于另一个参数值?

Android webkit.WebView 和 HTML5

r - R 中的 Websocket