Hopital en PLS

This commit is contained in:
Xamora
2023-11-22 15:50:42 +01:00
parent 267eeab896
commit 6e624dad34
11 changed files with 68 additions and 35 deletions

View File

@ -10,7 +10,17 @@ https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
import os
from django.core.asgi import get_asgi_application
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
import chat.routing
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'trancendence.settings')
application = get_asgi_application()
application = ProtocolTypeRouter({
'http':get_asgi_application(),
'websocket':AuthMiddlewareStack(
URLRouter(
chat.routing.websocket_urlpatterns
)
),
})

View File

@ -38,6 +38,9 @@ CORS_ORIGIN_WHITELIST = (
# Application definition
INSTALLED_APPS = [
'channels',
'accounts.apps.AccountsConfig',
'profiles.apps.ProfilesConfig',
'frontend.apps.FrontendConfig',
@ -52,6 +55,8 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
]
ASGI_APPLICATION = 'trancendence.asgi.application'
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',