I've just started to learn about channels and asgi in django .... and in few tutorials that i've seen they do this to configure the asgi apllication
asgi.py
import os
from django.core.asgi import get_asgi_application
from channels.routing import ProtocolTypeRouter, URLRouter
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mywebsite.settings')
application = ProtocolTypeRouter({
'http':get_asgi_application(),
})
settings.py
INSTALLED_APPS = [
'channels',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'chat'
]
ASGI_APPLICATION = 'mywebsite.asgi.application'
to check when i run my server it was supposed to be running on asgi/channel server like this
Starting ASGI/Channels version development server at http://127.0.0.1:8000/
but mine is still running on the default one
Starting development server at http://127.0.0.1:8000/
when i use daphne and put inside installed apps instead of channels
'daphne',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'chat'
]
it works fine
Starting ASGI/Daphne version 4.0.0 development server at http://127.0.0.1:8000/
can someone tell me what is going on here?and how exactly django works with asgi?