Django
Django
A R U N A R U N I S T O
In Django, "channels" refer to a powerful
extension that allows you to handle real-
time functionality in your web applications.
Traditionally, Django is a synchronous web
framework, meaning it processes requests
one at a time and is not well-suited for
handling real-time features like chat,
notifications, or live updates.
Django Channels introduces an
asynchronous layer to Django, enabling you
to build applications that can handle
asynchronous events and real-time
communication.
os.environ.setdefault('DJANGO_SETTINGS_MODU
LE', 'mysite.settings')
‘’’ Initialize Django ASGI application early to ensure
the AppRegistry is populated before importing
code that may import ORM models. ‘’’
django_asgi_app = get_asgi_application()
application = ProtocolTypeRouter({
"http": django_asgi_app,
})
And finally, set your ASGI_APPLICATION
setting to point to that routing object as
your root application. add this in your
settings.py file
ASGI_APPLICATION = "<project_name>.asgi.application"
Real-time examples:
1. Chat Applications
2. Live Notifications
3. Collaborative Editing
4. Online Gaming
5. Live Updates
6. IoT Control
7. Live Polls and Surveys
8. Collaborative Project Management
9. Location Tracking
10. Customer Support Chat
11. Live Streaming