Django MCQ Questions

11. In Django, views have to be created in the app views.py file.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


12. Render function takes ___________ parameters.

A. 1
B. 2
C. 3
D. 4

View Answer


13. A variable in django looks like this: _________________.

A. ((variable))
B. {{variable}}
C. [[variable]]
D. [{variable}]

View Answer


14. Which filter will truncate the string, so you will see only the first 80 words?

A. {{string|truncatewords}}
B. {{string|truncate:80}}
C. {{string|truncate}}
D. {{string|truncatewords:80}}

View Answer


15. How many kinds of HTTP requests there in Django?

A. 2
B. 3
C. 4
D. 5

View Answer


16. Suppose you want to count the number of books in Django.Which implementation would be fastest?

books = Book.objects.all()

A. Template Language Implementation – {{ books | length }}
B. Python Implementation – len(books)
C. Database level Implementation – books.count()
D. None of the above

View Answer


17. Which of these variables are the settings for django.contib.staticfiles app?

A. STATIC_URL
B. STATIC_ROOT
C.  STATICFILES_DIRS
D. All of the above

View Answer


18. What are some valid forloop attributes of Django Template System?

A. forloop.lastitem
B.  forloop.counter
C. forloop.firstitem
D. forloop.reverse

View Answer


19. Django Comments framework is deprecated, since the 1.5 version.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


20. Which of these is not a valid method or approach to perform URL resolution?

A. Using Template {{ url : }} in template
B. Using reverse() in View Functions
C. Using get_absolute_url()
D. None of the above

View Answer





Discussion


* You must be logged in to add comment.