Google News
logo
Django - Quiz(MCQ)
A)
Python
B)
Java
C)
PHP
D)
C Language

Correct Answer : Option (A) :   Python

A)
Tool
B)
Software
C)
Web framework
D)
Programming Language

Correct Answer : Option (C) :   Web framework

A)
Bill Gates
B)
Adrian Holovaty
C)
Rasmus Lerdorf
D)
Tim Berners-Lee

Correct Answer : Option (B) :   Adrian Holovaty

A)
Django app is a python package with its own components.
B)
Django app is an extended package with base package is Django
C)
Both (A) and (B)
D)
None of the above

Correct Answer : Option (C) :   Both (A) and (B)

A)
2000
B)
2001
C)
2002
D)
2003

Correct Answer : Option (D) :   2003


Explanation :

* Adrian Holovaty and Simon Willison created Django in the fall of 2003 at the Lawrence Journal-World newspaper

A)
21 July 2003
B)
21 July 2004
C)
21 July 2005
D)
21 July 2006

Correct Answer : Option (C) :   21 July 2005


Explanation :

Adrian Holovaty and Simon Willison created Django in the fall of 2003 at the Lawrence Journal-World newspaper

Django publicly released under a BSD license in 21st July 2005; named after guitarist Django Reinhardt

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

Correct Answer : Option (A) :   high-level


Explanation : Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design.

A)
Form handling
B)
Templating
C)
Admin Interface (CRUD)
D)
All of the above

Correct Answer : Option (D) :   All of the above

A)
PHP
B)
MVT
C)
CSS
D)
HTML

Correct Answer : Option (B) :   MVT

A)
render
B)
render_to_response
C)
render_to_html
D)
response_render

Correct Answer : Option (B) :   render_to_response

A)
They are files saved in migrations directory.
B)
They are created when you run makemigrations command.
C)
Migrations are files where Django stores changes to your models.
D)
All of the above

Correct Answer : Option (D) :   All of the above

A)
ordinal
B)
intword
C)
apnumber
D)
intcomma

Correct Answer : Option (C) :   apnumber

A)
django.core.cache.backends.sys.memory
B)
django.core.cache.backends.db.DatabaseCache
C)
django.core.cache.backends.locmem.LocMemCache
D)
None of the above

Correct Answer : Option (A) :   django.core.cache.backends.sys.memory

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

Correct Answer : Option (A) :   MVC


Explanation : Django supports the Model-View-Controller (MVC) design pattern.

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

Correct Answer : Option (B) :   Model-View-Template


Explanation : The Model-View-Template (MVT) is slightly different from MVC. The template is a HTML file mixed with Django Template Language (DTL).

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

Correct Answer : Option (C) :   3


Explanation : MVC pattern is based on three components : Model, View, and Controller.

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

Correct Answer : Option (D) :   All of the above


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.

A)
{{ name }} will be the output.
B)
It will be displayed as name in HTML.
C)
The name will be replaced with values of Python variable.
D)
None of the above

Correct Answer : Option (C) :   The name will be replaced with values of Python variable.

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

Correct Answer : Option (A) :   forloop.counter


Explanation : forloop.counter valid forloop attributes of Django Template System.

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

Correct Answer : Option (B) :   $ django-admin startproject project_name


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. 

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

Correct Answer : Option (B) :   manage.py


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...).

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

Correct Answer : Option (A) :   wsgi.py


Explanation : wsgi.py is used if you need to deploy your project over WSGI.

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

Correct Answer : Option (D) :   2


Explanation : There are two kinds of HTTP requests, GET and POST.

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

Correct Answer : Option (D) :   All of the above


Explanation : All of the above are variables are the settings for django.contib.staticfiles app.

A)
AJP
B)
SCGI
C)
mod_wsgi
D)
FastCGI

Correct Answer : Option (C) :   mod_wsgi

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

Correct Answer : Option (D) :   None of the above


Explanation : None of the above is not a valid method or approach to perform URL resolution.

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

Correct Answer : Option (A) :   {{string|truncatewords:80}}


Explanation : {{string|truncatewords:80}} : This filter will truncate the string, so you will see only the first 80 words.

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

Correct Answer : Option (B) :   {{variable}}


Explanation : Displaying Variables : A variable looks like this: {{variable}}

A)
To sync the database schema
B)
To configure settings for an app
C)
To configure settings for the Django project
D)
To set the date and time on the server

Correct Answer : Option (C) :   To configure settings for the Django project

A)
In-memory caching
B)
File sytem caching
C)
Both (A) and (B)
D)
None of the above

Correct Answer : Option (C) :   Both (A) and (B)

A)
User.object.all()
B)
User.all_records()
C)
Users.objects.all()
D)
User.objects.all()

Correct Answer : Option (D) :   User.objects.all()

A)
TRUE
B)
FALSE
C)
None of the above
D)

Correct Answer : Option (A) :   TRUE


Explanation : True, In Django, views have to be created in the app views.py file.

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

Correct Answer : Option (B) :   3


Explanation : This function takes three parameters : Request, The path to the template and Dictionary of parameters.

34 .
Suppose you want to count the number of books in Django.Which implementation would be fastest?
 
books = Book.objects.all()
A)
Python Implementation – len(books)
B)
Database level Implementation – books.count()
C)
Template Language Implementation – {{ books | length }}
D)
None of the above

Correct Answer : Option (B) :   Database level Implementation – books.count()


Explaination : Database level Implementation – books.count() implementation would be fastest.