implement websocket connections

This commit is contained in:
Joel Mathew Thomas
2025-03-19 23:44:55 +05:30
parent c96b74c463
commit e1e7464bb7
8 changed files with 289 additions and 146 deletions
+9
View File
@@ -31,6 +31,8 @@ ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'daphne',
'channels',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@@ -72,7 +74,14 @@ TEMPLATES = [
]
WSGI_APPLICATION = 'backend.wsgi.application'
ASGI_APPLICATION = "backend.asgi.application"
# Redis setup for WebSocket communication
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels.layers.InMemoryChannelLayer"
}
}
# Database
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases