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
Ans : C
Explanation: Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design.
2. Django was created in the fall of?
A. 2001
B. 2003
C. 2005
D. 2007
View Answer
Ans : B
Explanation: 2003 : Started by Adrian Holovaty and Simon Willison as an internal project at the Lawrence Journal-World newspaper.
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
Ans : D
Explanation: All of the above are advantages of using Django.
4. Django supports the ___________ pattern.
A. MVI
B. MVP
C. MVC
D. MVZ
View Answer
Ans : C
Explanation: Django supports the MVC pattern.
5. MVC pattern is based on _______ components.
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : B
Explanation: MVC pattern is based on three components: Model, View, and Controller.
6. MVT Stands for?
A. Model-View-Template
B. Model-View-Table
C. Map-View-Template
D. Main-View-Template
View Answer
Ans : A
Explanation: The Model-View-Template (MVT) is slightly different from MVC. The template is a HTML file mixed with Django Template Language (DTL).
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
Ans : C
Explanation: Whether you are on Windows or Linux, just get a terminal or a cmd prompt and navigate to the place you want your project to be created, then use this code : $ django-admin startproject project_name.
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
Ans : D
Explanation: manage.py : This file is kind of your project local django-admin for interacting with your project via command line (start the development server, sync db...).
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
Ans : B
Explanation: wsgi.py is used if you need to deploy your project over WSGI.
10. View response can be the ?
A. HTML contents
B. 404 error
C. XML document
D. All of the above
View Answer
Ans : D
Explanation: View response can be the HTML contents of a Web page, or a redirect, or a 404 error, or an XML document, or an image.
Discussion