Home / CSE MCQs / Django ::

CSE MCQs :: Django

  1. What is the Django shortcut method to more easily render an html response?
  2. A.
    render_to_html
    B.
    render_to_response
    C.
    response_render
    D.
    render

  3. By using django.contrib.humanize, you can use the following filter in your template to display the number 3 as three.
  4. A.
    apnumber
    B.
    intcomma
    C.
    intword
    D.
    ordinal

  5. How do you concatenate two QuerySets into one list?
  6. A.
    result = list(query_set_1 | query_set_2)
    B.

    from itertools import chain

    C.
    from django.db.models import Q result = Q(query_set_1) | Q(query_set_1)
    D.
    result = query_set_1 + query_set_2

  7. What is the Django command to start a new app named 'users' in an existing project?
  8. A.
    manage.py "“newapp users
    B.
    manage.py newapp users
    C.
    manage.py "“startapp users
    D.
    manage.py startapp users

  9. What are the features available in Django web framework?
  10. A.
    Admin Interface (CRUD)
    B.
    Templating
    C.
    Form handling
    D.
    All of the above

  11. What are the advantages of using Django for web development?
  12. A.
    It facilitates you to divide code modules into logical groups to make it flexible to change
    B.
    It provides auto-generated web admin to make website administration easy
    C.
    It provides pre-packaged API for common user tasks
    D.
    All of the above

  13. What is the most easiest, fastest, and most stable deployment choice in most cases with Django?
  14. A.
    FastCGI
    B.
    mod_wsgi
    C.
    SCGI
    D.
    AJP

  15. What happens if MyObject.objects.get() is called with parameters that do not match an existing item in the database?
  16. A.
    The Http404 exception is raised
    B.
    The DatabaseError exception is raised
    C.
    The MyObject.DoesNotExist exception is raised
    D.
    The object is created and returned

  17. What Commands are used to create a project in Django?
  18. A.
    Project
    B.
    _init_.py
    C.
    manage.py
    D.
    All of the above mentioned

  19. What is the Django command to view a database schema of an existing (or legacy) database?
  20. A.
    manage.py legacydb
    B.
    django-admin.py schemadump
    C.
    manage.py inspect
    D.
    manage.py inspectdb