mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 03:58:26 +02:00
Initialize chat interface
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -22,13 +22,13 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tfjm.settings')
|
||||
django_asgi_app = get_asgi_application()
|
||||
|
||||
# useful since the import must be done after the application initialization
|
||||
import draw.routing # noqa: E402, I202
|
||||
import tfjm.routing # noqa: E402, I202
|
||||
|
||||
application = ProtocolTypeRouter(
|
||||
{
|
||||
"http": django_asgi_app,
|
||||
"websocket": AllowedHostsOriginValidator(
|
||||
AuthMiddlewareStack(URLRouter(draw.routing.websocket_urlpatterns))
|
||||
AuthMiddlewareStack(URLRouter(tfjm.routing.websocket_urlpatterns))
|
||||
),
|
||||
}
|
||||
)
|
||||
|
11
tfjm/routing.py
Normal file
11
tfjm/routing.py
Normal file
@ -0,0 +1,11 @@
|
||||
# Copyright (C) 2024 by Animath
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import chat.consumers
|
||||
from django.urls import path
|
||||
import draw.consumers
|
||||
|
||||
websocket_urlpatterns = [
|
||||
path("ws/chat/", chat.consumers.ChatConsumer.as_asgi()),
|
||||
path("ws/draw/", draw.consumers.DrawConsumer.as_asgi()),
|
||||
]
|
@ -62,8 +62,8 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<li class="nav-item active d-none">
|
||||
<a class="nav-link" href="{% url "participation:chat" %}">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{% url "chat:chat" %}">
|
||||
<i class="fas fa-comments"></i> {% trans "Chat" %}
|
||||
</a>
|
||||
</li>
|
||||
|
@ -37,7 +37,7 @@ urlpatterns = [
|
||||
path('search/', AdminSearchView.as_view(), name="haystack_search"),
|
||||
|
||||
path('api/', include('api.urls')),
|
||||
# path('chat/', include('chat.urls')),
|
||||
path('chat/', include('chat.urls')),
|
||||
path('draw/', include('draw.urls')),
|
||||
path('participation/', include('participation.urls')),
|
||||
path('registration/', include('registration.urls')),
|
||||
|
Reference in New Issue
Block a user