Files
RasadDam_Backend/Rasaddam_Backend/asgi.py
2025-09-20 16:58:24 +03:30

33 lines
929 B
Python

"""
ASGI config for Rasaddam_Backend project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
"""
# import os
#
# from django.core.asgi import get_asgi_application # noqa
#
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Rasaddam_Backend.settings') # noqa
#
# application = get_asgi_application() # noqa
import os
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
from channels.auth import AuthMiddlewareStack
from apps.authentication.websocket import routing
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "your_project_name.settings")
application = ProtocolTypeRouter({
"http": get_asgi_application(),
"websocket": AuthMiddlewareStack(
URLRouter(
routing.websocket_urlpatterns
)
),
})