Bird
0
0

Which of the following is the correct way to specify an ASGI application in Django's asgi.py file?

easy📝 Syntax Q12 of 15
Django - Async Django
Which of the following is the correct way to specify an ASGI application in Django's asgi.py file?
Aapplication = get_wsgi_application()
Bapplication = get_application()
Capplication = get_asgi_application()
Dapplication = asgi_application()
Step-by-Step Solution
Solution:
  1. Step 1: Recall Django's ASGI setup

    Django provides get_asgi_application() to create the ASGI application instance.
  2. Step 2: Compare options

    get_wsgi_application() is for WSGI, others are incorrect function names.
  3. Final Answer:

    application = get_asgi_application() -> Option C
  4. Quick Check:

    ASGI uses get_asgi_application() [OK]
Quick Trick: ASGI uses get_asgi_application(), WSGI uses get_wsgi_application() [OK]
Common Mistakes:
MISTAKES
  • Using get_wsgi_application() in asgi.py
  • Misspelling function names
  • Confusing application variable names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes