Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

HttpRequest object is automatically created by Django when a page is refreshed.

Answer»

HttpRequest OBJECT is automatically CREATED by Django when a page is refreshed.
Choose the correct option from below list
(1)TRUE
(2)False

Answer:-(1)True

2.

Which view can be used to show the detail of an object?

Answer»

Which view can be used to SHOW the DETAIL of an OBJECT?
Choose the correct option from below list
(1)DetailView
(2)TemplateView
(3)ListView
(4)View

Answer:-(1)DetailView

3.

Which of these databases are not by default supported by Django?

Answer»

Which of these DATABASES are not by default SUPPORTED by DJANGO?
Choose the correct option from below list
(1)Postgres
(2)MONGODB
(3)Sqlite
(4)Mysql

Answer:-(2)Mongodb

4.

filesizeformat filter in a template, provides the output in a human readable format.

Answer»

filesizeformat filter in a template, provides the output in a human readable format.
Choose the correct OPTION from below LIST
(1)True
(2)False

Answer:-(1)True

5.

Mixins are a form of multiple inheritance where behaviors and attributes of multiple parent classes can be combined.

Answer»

Mixins are a FORM of multiple INHERITANCE where BEHAVIORS and attributes of multiple parent classes can be combined.
Choose the correct option from below list
(1)True
(2)False

Answer:-(1)True

6.

To render the form as a series of < li> tags, use_______.

Answer»

To RENDER the form as a series of li tags, use_______.
Choose the CORRECT option from below list
(1)Form.as_p()
(2)Form.as_ul()
(3)form.as_li()
(4)Form.as_table()

Answer:-(2)Form.as_ul()

7.

Django is written in which programming language?

Answer» DJANGO is written in which programming language?
Choose the correct OPTION from below LIST
(1)PHP
(2)Python
(3)JAVA
(4)C++

Answer:-(2)Python
8.

Which is the default port for the Django development server?

Answer»

Which is the DEFAULT port for the Django DEVELOPMENT server?
Choose the correct option from below list
(1)8080
(2)8081
(3)8000
(4)9000

Answer:-(3)8000

9.

What is the use of the post_delete signal in Django?

Answer»

What is the USE of the post_delete SIGNAL in Django?
CHOOSE the correct option from below list
(1)Sent before a MODEL s save() method is CALLED
(2)Sent after a model s save() method is called
(3)Sent before a model s delete() method is called
(4)Sent after a model s delete() method is called

Answer:-(4)Sent after a model s delete() method is called

10.

A custom path converter is a class that includes _______.

Answer»

A custom path CONVERTER is a class that INCLUDES _______.
CHOOSE the correct option from below list
(1)to_python(self, value) method
(2)REGEX string
(3)to_url(self,value) method
(4)All the options

Answer:-(4)All the options

11.

Which option does Django templates accept?

Answer»

Which OPTION does Django templates accept?
Choose the CORRECT option from below list
(1)All the options
(2)LIBRARIES
(3)LOADERS
(4)autoescape
(5)context_processors

Answer:-(1)All the options

12.

Sessions are __________.

Answer»

Sessions are __________.
Choose the CORRECT option from below list
(1)cached
(2)All the options
(3)File-based
(4)Database-backed
(5)Cookie-based

Answer:-(2)All the options

13.

Which template configuration defines a list of directories where the engine should look for template source files, in search order?

Answer»

Which template configuration defines a list of directories where the engine should look for template SOURCE files, in search ORDER?
Choose the correct OPTION from below list
(1)DIRS
(2)APP_DIRS
(3)OPTIONS
(4)BACKEND

Answer:-(1)DIRS

14.

What is the output of the following code?

Answer»

What is the OUTPUT of the following code?
>>> from Django IMPORT forms
>>> f = forms.CharField()
>>> f.clean('')
Choose the CORRECT option from below list
(1)None
(2)
(3)True
(4)Validation Error

Answer:-(4)Validation Error

15.

Identify the incorrect path argument.

Answer»

Identify the incorrect path argument.
Choose the CORRECT OPTION from below list
(1)model
(2)VIEW
(3)route
(4)name

Answer:-(1)model

16.

A Form instance is either bound to a set of data or unbound.

Answer»

A Form INSTANCE is either BOUND to a set of data or unbound.
Choose the CORRECT option from below list
(1)TRUE
(2)False

Answer:-(1)True

17.

Which is a valid path converter?

Answer»

Which is a valid path converter?
Choose the CORRECT OPTION from below list
(1)str and INT
(2)str
(3)All the options
(4)slug
(5)uuid
(6)int

Answer:-(3)All the options

18.

By default, Django serializes session using ________.

Answer»

By default, Django serializes session using ________.
CHOOSE the correct option from below list
(1)both OPTIONS
(2)json
(3)NONE of the options
(4)pickle

Answer:-(2)json

19.

urlpatterns should be a python list of ______ instances.

Answer»

urlpatterns should be a python list of ______ instances.
Choose the correct option from below list
(1)PATH()
(2)re_path()
(3)None of the OPTIONS
(4)both options

Answer:-(4)both options

20.

Since the template language doesn t provide exception handling, any exception raised from a template filter will be exposed as a server error.

Answer»

Since the TEMPLATE language doesn t provide exception handling, any exception raised from a template filter will be EXPOSED as a server error.
Choose the CORRECT option from below LIST
(1)True
(2)False

Answer:-(1)True

21.

Consider the following code where f is a Form object.

Answer»

Consider the following code where f is a FORM object.
>>> f = ContactForm()
>>> print(f)
What is the output?
Choose the correct option from below list
(1)The form is not rendered
(2)None of the options
(3)An error is DISPLAYED
(4)The form RENDERS as HTML

Answer:-(4)The form renders as HTML

22.

Which view decorator module can be used to control server and client side caching?

Answer»

Which view decorator module can be used to control server and CLIENT side CACHING?
Choose the correct option from below list
(1)django.views.decorators.http
(2)django.views.decorators.cache
(3)django.views.decorators.gzip***
(4)django.views.decorators.vary

Answer:-(2)django.views.decorators.cache

23.

You cannot have spaces or punctuation characters in variable names.

Answer»

You cannot have SPACES or PUNCTUATION characters in variable names.
Choose the correct OPTION from below list
(1)TRUE
(2)False

Answer:-(1)True

24.

There are many error views by default in Django. Identify the incorrect one.

Answer»

There are many error VIEWS by DEFAULT in DJANGO. Identify the incorrect one.
Choose the correct option from below list
(1)http_forbidden()
(2)permission_denied()
(3)page_not_found()
(4)server_error()
(5)bad_request()

Answer:-(1)http_forbidden()

25.

Generic views ____________.

Answer»

Generic views ____________.
Choose the correct option from below LIST
(1)Display list and detail pages for a single object
(2)All the options
(3)PRESENT date-based objects in year/month/day ARCHIVE pages
(4)ALLOW users to create, update, and delete objects

Answer:-(2)All the options

26.

To declare the initial value of form fields at runtime, use ________.

Answer»

To declare the initial value of FORM FIELDS at runtime, use ________.
Choose the CORRECT option from below LIST
(1)Form.initial
(2)Form.start
(3)Form.first
(4)Form.index

Answer:-(1)Form.initial

27.

The clean() method on a Field subclass is responsible for running ________.

Answer»

The clean() method on a FIELD subclass is RESPONSIBLE for running ________.
Choose the correct option from below list
(1)to_python()
(2)All the options
(3)validate()
(4)run_validators()

Answer:-(2)All the options

28.

Give some introduction about Django

Answer» GIVE some introduction about Django
Django is free and OPEN SOURCE framework for web application. And it is written in Python. Django is server side web framework. And this will helps you to create secure and maintainable WEBSITES.
29.

Identify the invalid form field attributes.

Answer»

Identify the INVALID FORM field attributes.
Choose the CORRECT option from below LIST
(1){{ field.help_text }}
(2){{ field.invalid }}
(3){{ field.errors }}
(4){{ field.value }}

Answer:-(2){{ field.invalid }}

30.

Which shortcut function returns the result of filter() on a given model manager cast to a list, raising Http404 if the resulting list is empty?

Answer»

Which shortcut function returns the result of filter() on a given model MANAGER cast to a list, raising Http404 if the resulting list is empty?
Choose the correct OPTION from below list
(1)render_to_response()
(2)get_list_or_404()
(3)RENDER()
(4)get_object_or_404()

Answer:-(2)get_list_or_404()

31.

When a template system encounters a dot, it tries _______.

Answer»

When a template system encounters a dot, it tries _______.
Choose the CORRECT OPTION from below list
(1)ATTRIBUTE or method LOOKUP
(2)All the options
(3)Dictionary lookup
(4)Numeric index lookup

Answer:-(2)All the options

32.

Which filter is available if {% load humanize %} is used in template?

Answer»

Which filter is available if {% load HUMANIZE %} is USED in template?
Choose the CORRECT option from below list
(1)naturaltime
(2)naturalday
(3)apnumber
(4)All the OPTIONS
(5)intcomma
(6)intword

ANSWER:-(4)All the options

33.

Identify the incorrect middleware hook.

Answer»

Identify the incorrect middleware hook.
Choose the CORRECT option from below list
(1)template_view()
(2)process_exception()
(3)process_template_response()
(4)process_view()

Answer:-(1)template_view()

34.

A ______ is a layer of abstraction to work with multiple forms on the same page.

Answer»

A ______ is a LAYER of abstraction to work with multiple forms on the same page.
Choose the CORRECT option from below LIST
(1)ModelForm
(2)Formset
(3)All the options
(4)InlineForm

Answer:-(2)Formset

35.

Which file is responsible for the configurations of the Django applications?

Answer»

Which file is RESPONSIBLE for the CONFIGURATIONS of the DJANGO applications?
Choose the correct option from below list
(1)settings.py
(2)manage.py
(3)wsgi.py
(4)app.py

Answer:-(1)settings.py