0.3.26
support chat v3
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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': {
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user