Django Channel Error构建聊天应用程序

时间:2020-09-04 15:02:23

标签: python django channel django-channels asgi

我正在尝试使用Django和channel构建聊天应用程序。 但是我无法获取我的视图文件(room.html) 我的主要项目名称是“ techChat”,我有一个名为“聊天”的应用 我正在尝试以下所有代码:-https://channels.readthedocs.io/en/latest/tutorial/part_2.html 当我输入大厅名称时,找不到页面。如果您看一下下面的img的文件结构,那么我也有asgi文件。

帮助!

我的代码

views.py:-

enter image description here

聊天/urls.py(应用url文件):-

chat/urls.py (App urls file)

techChat / urls.py(主项目urls文件)

techChat/urls.py (main project urls file)

我的room.html模板文件:- enter image description here

我的index.htm文件模板 enter image description here

This Is How My File Structure Is

我的索引页输出:- enter image description here

现在,当我在文本框中输入“大厅”时,出现“找不到页面”错误! enter image description here

0 个答案:

没有答案