Menu mobile
Home
Programming
Python Tutorial
Java Tutorial
C Tutorial
C++ Tutorial
Web Technology
HTML
CSS
Java Script
PHP
React JS
Node JS
Assignment
MS Office
HTML
CSS
Bootstrap
Java Script
JQuery
AngularJs
Project
Blog
QUIZ ON : django - INTRODUCTION TO DJANGO
INTRODUCTION TO DJANGO
00:00:00
English
Hindi
Question No# :
01
out of 50
What is the purpose of Djangos get_object_or_404 function?
A.
To handle database migrations
B.
To retrieve an object from the database or return a 404 error
C.
To manage static files
D.
To define URL patterns
Question No# :
02
out of 50
The architecture of Django consists of?
The architecture of Django consists of?
A.
Models
Models
B.
Views
Views
C.
Templates
Templates
D.
All of these
All of these
Question No# :
03
out of 50
What is the purpose of Djangos DjangoTestCase class in the context of testing?
A.
To handle user authentication in test cases
B.
To provide a base class for writing Django test cases
C.
To define URL patterns for testing views
D.
To create fake data for testing purposes
Question No# :
04
out of 50
What is the purpose of Djangos DjangoTestCase class in the context of testing?
A.
To handle user authentication in test cases
B.
To provide a base class for writing Django test cases
C.
To define URL patterns for testing views
D.
To create fake data for testing purposes
Question No# :
05
out of 50
How can you handle file uploads in Django forms?
A.
By using the FileField in the form
B.
By using the ImageField in the form
C.
By adding a custom file handling function in the view
D.
File uploads are not supported in Django forms
Question No# :
06
out of 50
How can you use Djangos django.contrib.auth.views.login view with a custom template?
A.
By creating a custom template and specifying it in the urls.py file
B.
By using the {% extends %} template tag in the custom template
C.
By setting the LOGIN_TEMPLATE variable in the projects settings
D.
By modifying the login.html template in the auth app
Question No# :
07
out of 50
What is the purpose of Djangos django.contrib.sessions.middleware.SessionMiddleware?
A.
To define URL patterns for sessions
B.
To handle user authentication through sessions
C.
To manage server-side sessions and store session data
D.
Sessions are not supported in Django
Question No# :
08
out of 50
What does Djangos TestCase class provide for testing?
A.
It handles user authentication in test cases
B.
It defines URL patterns for testing views
C.
It provides a set of tools and assertions for testing Django applications
D.
It generates fake data for testing purposes
Question No# :
09
out of 50
How can you use Djangos django.contrib.auth.views.password_reset view function?
A.
By including it in the projects urls.py file
B.
By manually creating a URL pattern for password reset
C.
By using the {% password_reset %} template tag
D.
All of the above
Question No# :
10
out of 50
What is the purpose of Djangos django.contrib.humanize app?
A.
To define URL patterns for human-readable URLs
B.
To handle user authentication through humanized interfaces
C.
To provide a set of template filters for human-readable output
D.
Humanization features are not supported in Django
Question No# :
11
out of 50
What does the Django filter() method do in a QuerySet?
A.
It filters out None values from the QuerySet
B.
It filters the QuerySet based on specified conditions
C.
It sorts the QuerySet in ascending order
D.
It retrieves all objects from the QuerySet
Question No# :
12
out of 50
How can you use Djangos redirect function to redirect to a URL?
A.
redirect("https://example.com")
B.
redirect(view_name)
C.
redirect(reverse(view_name))
D.
All of the above
Question No# :
13
out of 50
What is the purpose of Djangos django.contrib.messages.middleware.MessageMiddleware?
A.
To define URL patterns for messages
B.
To handle user authentication through messages
C.
To manage messages and store them in the session
D.
To manage static files for messages
Question No# :
14
out of 50
How does Django support internationalization (i18n) and localization (l10n)?
A.
By automatically translating all text in templates
B.
By using the translate template tag
C.
By providing the gettext module for Python code
D.
All of the above
Question No# :
15
out of 50
How does Django handle user authentication?
A.
By using the auth app
B.
By including a users module in each app
C.
By manually implementing authentication in each view
D.
By default, Django does not provide user authentication
Question No# :
16
out of 50
What does the Django reverse() function do?
A.
It reverses the order of elements in a list
B.
It reverses the order of characters in a string
C.
It generates a URL based on a view name and arguments
D.
It reverses the order of elements in a dictionary
Question No# :
17
out of 50
Which Django command is used to create a superuser for the Django admin interface?
A.
createsuperuser
B.
makeadmin
C.
addadmin
D.
initadmin
Question No# :
18
out of 50
What is the purpose of Djangos middleware named CommonMiddleware?
A.
It manages common database operations
B.
It handles user authentication
C.
It adds various HTTP headers to responses
D.
It defines common URL patterns
Question No# :
19
out of 50
What does the Django @require_POST decorator do?
A.
It requires that a view can only be accessed with a POST request
B.
It requires user authentication for a view
C.
It enforces HTTPS for a view
D.
It requires that a view can only be accessed with a GET request
Question No# :
20
out of 50
How can you include a custom Django template tag library in a template?
A.
By using the {% load %} template tag
B.
By importing the library directly in the Python code
C.
By defining a custom {% tag %} tag in the template
D.
Template tag libraries cannot be included in templates
Question No# :
21
out of 50
What is the purpose of Djangos SELECT_RELATED and PREFETCH_RELATED queryset optimizations?
A.
They enable lazy loading of related objects
B.
They optimize database queries by selecting or prefetching related objects
C.
They handle user authentication
D.
They define URL patterns
Question No# :
22
out of 50
What does Djangos HttpResponseRedirect class do?
A.
It renders HTML templates
B.
It redirects the user to a different URL
C.
It handles form submissions
D.
It is used for AJAX requests
Question No# :
23
out of 50
What is the Django messages framework used for?
A.
To handle user authentication
B.
To manage static files
C.
To display messages to users across requests
D.
To define URL patterns
Question No# :
24
out of 50
How can you handle user authentication in Django views?
A.
By using the @require_authentication decorator
B.
By including the auth app in the projects INSTALLED_APPS
C.
By checking request.user.is_authenticated in the view
D.
By adding a User field in the views parameters
Question No# :
25
out of 50
Which command is used to create a new Django project?
A.
startproject
B.
createproject
C.
newproject
D.
initproject
Question No# :
26
out of 50
How does Django handle migrations for database schema changes?
A.
Manually update the database schema file
B.
Automatically generate and apply migration files
C.
Use raw SQL queries to update the database
D.
Migrations are not supported in Django
Question No# :
27
out of 50
What command is used to create a new Django app within a project?
A.
createapp
B.
startapp
C.
newapp
D.
initapp
Question No# :
28
out of 50
MVC pattern is based on _______ components.
MVC pattern is based on _______ components.
A.
2
2
B.
3
3
C.
4
4
D.
5
5
Question No# :
29
out of 50
What is the purpose of Djangos SESSION_COOKIE_SECURE setting?
A.
It determines whether the session cookie is secure (only sent over HTTPS)
B.
It sets the expiration time for session cookies
C.
It configures the path for session cookies
D.
It defines the session engine to be used
Question No# :
30
out of 50
What is Djangos django.contrib.syndication app used for?
A.
To define URL patterns for syndication feeds
B.
To handle user authentication through syndication feeds
C.
To manage static files for syndication feeds
D.
To create and manage syndication feeds in the admin interface
Question No# :
31
out of 50
How does Django handle URL namespaces?
A.
By using the namespace attribute in URL patterns
B.
By defining unique names for each URL pattern
C.
By using the url template tag in HTML
D.
Django does not support URL namespaces
Question No# :
32
out of 50
Which command is used to start the development server in Django?
A.
runserver
B.
startserver
C.
devserver
D.
initserver
Question No# :
33
out of 50
What is the purpose of Djangos SESSION_ENGINE setting?
A.
It defines the database engine for session storage
B.
It specifies the encryption algorithm for session data
C.
It configures the expiration time for sessions
D.
It determines the engine for template rendering
Question No# :
34
out of 50
How can you create a custom Django template filter?
A.
By subclassing the Filter class in the django.template module
B.
By defining a Python function and registering it using the @register.filter decorator
C.
By modifying the django.template.filters module
D.
By adding the filter directly in the template using the {% filter %} tag
Question No# :
35
out of 50
What does Djangos django.contrib.auth.views.login view function provide?
A.
It renders the login form
B.
It handles user authentication
C.
It defines URL patterns for login
D.
It creates a new user in the database
Question No# :
36
out of 50
What is the Django template language used for?
A.
To define database models
B.
To create URL patterns
C.
To define views
D.
To generate dynamic HTML content
Question No# :
37
out of 50
Django is a type of
Django is a type of
A.
Programming Language
Programming Language
B.
Software
Software
C.
Web framework
Web framework
D.
None of above
None of above
Question No# :
38
out of 50
What is the Django REST frameworks primary authentication class for API views?
A.
BasicAuthentication
B.
TokenAuthentication
C.
OAuthAuthentication
D.
SessionAuthentication
Question No# :
39
out of 50
What does Djangos django.contrib.redirects.middleware.RedirectFallbackMiddleware do?
A.
It handles user authentication for redirects
B.
It defines URL patterns for redirects
C.
It allows falling back to old URL patterns for redirecting
D.
It manages static files for redirects
Question No# :
40
out of 50
What does the settings.py configuration DEBUG = False do in a Django project?
A.
Enables debugging information for the project
B.
Disables debugging information for the project
C.
Enables testing mode for the project
D.
Disables the entire Django project
Question No# :
41
out of 50
What is the purpose of Djangos django.contrib.sitemaps app?
A.
To define URL patterns for sitemaps
B.
To handle user authentication through sitemaps
C.
To manage static files for sitemaps
D.
To create and manage sitemaps in the admin interface
Question No# :
42
out of 50
What is the purpose of Djangos middleware named AuthenticationMiddleware?
A.
It adds various HTTP headers to responses
B.
It handles user authentication
C.
It defines URL patterns
D.
It processes requests and responses globally before reaching views
Question No# :
43
out of 50
How can you include the CSRF token in a Django form?
A.
By manually adding it to the form HTML
B.
It is included automatically, no action needed
C.
By using the {% csrf_token %} template tag
D.
By setting the csrf_token attribute in the form class
Question No# :
44
out of 50
What is Djangos django.contrib.staticfiles.storage.ManifestStaticFilesStorage used for?
A.
To define URL patterns for static files
B.
To store static files in a manifest file for efficient serving
C.
To manage user authentication for static files
D.
To handle file uploads in static files
Question No# :
45
out of 50
What is the purpose of Djangos django.contrib.redirects app?
A.
To define URL patterns for redirects
B.
To manage static files for redirects
C.
To handle user authentication through redirects
D.
To create and manage URL redirects in the admin interface
Question No# :
46
out of 50
Which architectural pattern does django follow?
Which architectural pattern does django follow?
A.
PHP
PHP
B.
MVT
MVT
C.
HTML
HTML
D.
None of the above
None of the above
Question No# :
47
out of 50
How can you set up a one-to-many relationship in Django models?
A.
Using OneToOneField
B.
Using ManyToManyField
C.
Using ForeignKey
D.
Using CharField
Question No# :
48
out of 50
What is Djangos django.contrib.sessions app used for?
A.
To define URL patterns for sessions
B.
To handle user authentication through sessions
C.
To create and manage server-side sessions
D.
Sessions are not supported in Django
Question No# :
49
out of 50
What does Djangos django.db.models.signals module provide?
A.
It defines URL patterns
B.
It handles user authentication
C.
It allows decoupled applications to get notified when certain actions occur elsewhere in the application
D.
It manages static files
Question No# :
50
out of 50
Django was introduced by ...................
Django was introduced by ...................
A.
Adrian Holovaty
Adrian Holovaty
B.
Bill Gates
Bill Gates
C.
Rasmus Lerdorf
Rasmus Lerdorf
D.
Tim Berners-Lee
Tim Berners-Lee
Online Exam Quiz for One day Exam
Online Typing Test
CCC Online Test 2026
Best Computer Training Institute in Prayagraj (Allahabad)
Best Java Training Institute in Prayagraj (Allahabad)
Best Python Training Institute in Prayagraj (Allahabad)
O Level Online Test in Hindi
Best Website and Software Company in Allahabad