support chat v3
This commit is contained in:
SDE
2023-08-16 18:02:39 +03:00
parent 60bfa0fadb
commit 4a8d2ad8c8
3 changed files with 4 additions and 4 deletions

View File

@@ -13,8 +13,8 @@ register = template.Library()
# @register.filter('get_msg_side')
@register.simple_tag
def get_ws_port():
return settings.WS_PORT
def get_ws_address():
return settings.WS_ADDRESS
@register.simple_tag

View File

@@ -91,7 +91,7 @@ TEMPLATES = [
# WSGI_APPLICATION = 'TWB.wsgi.application'
ASGI_APPLICATION = 'TWB.asgi.application'
WS_PORT = 8000
WS_ADDRESS = 'localhost:8000'
CHANNEL_LAYERS = {
'default': {

View File

@@ -12,7 +12,7 @@
<script>
{#var user_id = {{ user.id }}#}
ws_url = `ws://localhost:{% get_ws_port %}/ws/socket-server/?user_id={{ user.id }}`;
ws_url = `ws://{% get_ws_address %}/ws/socket-server/?user_id={{ user.id }}`;
</script>