Django MCQ Questions & Answers

Django MCQs : This section focuses on "Django" of Python Frameworks. These Multiple Choice Questions (MCQ) should be practiced to improve the Django skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. Django is a _____________ Python web framework.

A. low-level
B. mid-level
C. high-level
D. None of the above

View Answer


2. Django was created in the fall of?

A. 2001
B. 2003
C. 2005
D. 2007

View Answer


3. Which of the following are Advantages of Django?

A. Object-Relational Mapping (ORM) Support
B. Multilingual Support
C. Administration GUI
D. Framework Support

View Answer


4. Django supports the ___________ pattern.

A. MVI
B. MVP
C. MVC
D. MVZ

View Answer


5. MVC pattern is based on _______ components.

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

View Answer


6. MVT Stands for?

A. Model-View-Template
B. Model-View-Table
C. Map-View-Template
D. Main-View-Template

View Answer


7. Which commands use to create a project in Django?

A. $ django-admin createproject project_name
B. $ django-admin startproject project_name
C. $ django startproject project_name
D. $ django createproject project_name

View Answer


8. Which file is kind of your project local django-admin for interacting with your project via command line?

A. settings.py
B. admin.py
C. models.py
D. manage.py

View Answer


9. Which of the following is used If you need to deploy your project over WSGI?

A. settings.py 
B. wsgi.py
C. urls.py
D. __init__.py

View Answer


10. View response can be the ?

A. HTML contents
B. 404 error
C. XML document
D. All of the above

View Answer


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.

Fadwa Taha
Good