0
0
Djangoframework~10 mins

ASGI vs WSGI in Django - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the correct Django server interface for synchronous applications.

Django
from django.core.handlers.[1] import WSGIHandler
Drag options to blanks, or click blank then click option'
Async
Bwsgi
Chttp
Dasgi
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'asgi' instead of 'wsgi' for synchronous handler import.
Confusing the module name with 'http' or 'sync'.
2fill in blank
medium

Complete the code to import the correct Django server interface for asynchronous applications.

Django
from django.core.handlers.[1] import ASGIHandler
Drag options to blanks, or click blank then click option'
Awsgi
Bhttp
Casync
Dasgi
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'wsgi' instead of 'asgi' for asynchronous handler import.
Confusing 'async' or 'http' as module names.
3fill in blank
hard

Fix the error in the code to correctly create an ASGI application callable.

Django
application = [1]()
Drag options to blanks, or click blank then click option'
AASGIHandler
BDjangoHandler
CWSGIHandler
DHttpHandler
Attempts:
3 left
💡 Hint
Common Mistakes
Using WSGIHandler for ASGI application callable.
Using non-existent handler names.
4fill in blank
hard

Fill both blanks to complete the ASGI application setup with Django's async interface.

Django
import django

django.setup()
application = [1]()  # Create the [2] callable
Drag options to blanks, or click blank then click option'
AASGIHandler
BWSGIHandler
Csynchronous
Dasynchronous
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing ASGIHandler with 'synchronous' callable.
Using WSGIHandler for async callable.
5fill in blank
hard

Fill all three blanks to create a dictionary mapping server interfaces to their Django handlers.

Django
handlers = {
    'wsgi': [1],
    'asgi': [2],
    'default': [3]
}
Drag options to blanks, or click blank then click option'
AWSGIHandler()
BASGIHandler()
CNone
DHttpHandler()
Attempts:
3 left
💡 Hint
Common Mistakes
Using handler classes without parentheses.
Assigning HttpHandler which does not exist.
Setting default to a handler instance instead of None.