From d8dc365b03e374beb63cf2ea66f7910a8265a189 Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Tue, 19 May 2020 21:24:48 +0200 Subject: [PATCH] webockets routes --- chat/templates/chat/chat_content.html | 4 ++-- .../__pycache__/settings.cpython-38.pyc | Bin 4651 -> 4658 bytes digitaleagentur/settings.py | 2 +- users/routing.py | 4 ++-- users/templates/users/base.html | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chat/templates/chat/chat_content.html b/chat/templates/chat/chat_content.html index c4549b8..51ba63a 100644 --- a/chat/templates/chat/chat_content.html +++ b/chat/templates/chat/chat_content.html @@ -121,10 +121,10 @@ $(document).ready(function(){ ws_string = 'ws://' } if(typeof chatwebsocket != "undefined"){ - chatwebsocket = new WebSocket(ws_string+window.location.host+"/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/") + chatwebsocket = new WebSocket(ws_string+window.location.host+"/ws/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/") } else{ - chatwebsocket = new WebSocket(ws_string+window.location.host+"/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/") + chatwebsocket = new WebSocket(ws_string+window.location.host+"/ws/chat/{{roomdata.creator.pk}}/{{roomdata.chatmember_single.pk}}/") } diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index 139f65719e86b7851479f88535ec8c1e47276106..27091d98180b5eecbf3d727208cd099c98295774 100644 GIT binary patch delta 314 zcmXYt$x6du6ovEuiA|9P3@Bo3t<^eIsY4w=jPq=rW3^tjwtC`kx+*T+_zWSqku2)k zUETNq;sf|Z{uVEs1LxyjINbMiBW)B6qg9bp%YBtTeIvns{Lz;P;vzy_{c%?7u^|-b*u)mLv4dTqc?|hb6O0nr!@giR2s!oOkdlbu2*+-_ zU~=aq^&xdZ{UAz1rva%!T+$G(Xc*U&L5W6i6VzEp zzTBx$)@4<#KIUdodE+#WTblSMQQS!~2~bYnPr;>W+(VZIW+3nY&y$sC7Ti%X)dsg! e{qgT7PgYP?t&d`h8slwRP%-C%nyCe^rvD4zfmtK~ delta 329 zcmXYrxlY4S5JmkSHja>u6bXR{Sy%!jgh0a9VD^27gs=<{0^G;LR8$l+`2{SCE(NaB zkzYX6d=gIjf4JRB@w z5ldLc3RY!=`mjcEtV<0hHn52;Y-302F2im^my8nF!@guVXmCp6kW#R4gk#YqnYuY? zaF\w+)/(?P\w+)/$', mainwebsocket.UsersChat), - re_path('main/', mainwebsocket.UsersConsumer), + re_path(r'ws/chat/(?P\w+)/(?P\w+)/$', mainwebsocket.UsersChat), + re_path('ws/', mainwebsocket.UsersConsumer), ] \ No newline at end of file diff --git a/users/templates/users/base.html b/users/templates/users/base.html index f2efde7..7db6a2d 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -659,7 +659,7 @@ $(document).ready(function(){ ws_string = 'ws://' } - const mainwebsocket = new WebSocket(ws_string+window.location.host+"/main/") + const mainwebsocket = new WebSocket(ws_string+window.location.host+"/ws/") mainwebsocket.onmessage = function(e) { if(e["data"] != "presence_update")