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
In Django, what is the purpose of the models.py file in an app?
A.
It contains URL patterns
B.
It defines the database models
C.
It handles user authentication
D.
It defines the views for the app
Question No# :
02
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
Question No# :
03
out of 50
What is the purpose of Djangos django.contrib.admin.sites module?
A.
To manage admin users
B.
To define URL patterns for the admin interface
C.
To customize the behavior of the admin interface
D.
To store information about admin models
Question No# :
04
out of 50
What is the purpose of Djangos forms.py file in an app?
A.
To define URL patterns
B.
To create HTML templates
C.
To define forms for user input
D.
To handle database migrations
Question No# :
05
out of 50
What is the purpose of Djangos django.contrib package?
A.
To handle user authentication
B.
To include third-party contributions and extensions
C.
To define URL patterns
D.
To create HTML templates
Question No# :
06
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# :
07
out of 50
Django supports the ___________ pattern.
Django supports the ___________ pattern.
A.
MVI
MVI
B.
MVP
MVP
C.
MVC
MVC
D.
MVZ
MVZ
Question No# :
08
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# :
09
out of 50
What is Djangos TestCase class used for in the context of testing?
A.
To define URL patterns for testing views
B.
To create Django projects for testing purposes
C.
To provide a base class for writing test cases
D.
To manage static files in test environments
Question No# :
10
out of 50
What is the purpose of Djangos django.contrib.auth.models.Group model?
A.
To store information about user groups
B.
To define URL patterns for user groups
C.
To manage static files for user groups
D.
Groups are not supported in Django
Question No# :
11
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# :
12
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# :
13
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# :
14
out of 50
How does Django handle static files (e.g., CSS, JavaScript) in a project?
A.
Automatically, no configuration needed
B.
By using the staticfiles app
C.
By including them in the urls.py file
D.
By placing them in the templates folder
Question No# :
15
out of 50
How does Django handle security measures like Cross-Site Scripting (XSS)?
A.
By relying on the browser to handle security
B.
By escaping data in templates by default
C.
By ignoring security concerns
D.
By requiring developers to manually sanitize all input
Question No# :
16
out of 50
What is a Django App?
What is a Django App?
A.
Django app is an extended package with base package is Django
Django app is an extended package with base package is Django
B.
Django app is a python package with its own components.
Django app is a python package with its own components.
C.
Both 1 & 2 Option
Both 1 & 2 Option
D.
All of the above
All of the above
Question No# :
17
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# :
18
out of 50
What is Djangos purpose in handling database transactions?
A.
To provide an interface for querying databases
B.
To ensure data consistency and integrity
C.
To handle user authentication
D.
To define URL patterns
Question No# :
19
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# :
20
out of 50
What is the role of Djangos ORM (Object-Relational Mapping)?
A.
To handle user authentication
B.
To define URL patterns
C.
To map Python objects to database tables
D.
To create HTML templates
Question No# :
21
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# :
22
out of 50
Which database systems does Django support out of the box?
A.
MySQL only
B.
PostgreSQL only
C.
SQLite, PostgreSQL, MySQL, and Oracle
D.
MongoDB only
Question No# :
23
out of 50
How can you use Djangos django.contrib.auth.views.logout view function?
A.
logout(request)
B.
logout_user(request)
C.
auth_logout(request)
D.
All of the above
Question No# :
24
out of 50
What is the purpose of Djangos Django REST framework?
A.
It is used for asynchronous programming
B.
It provides tools for building Web APIs
C.
It is a template engine for Django
D.
It handles database migrations
Question No# :
25
out of 50
What is the primary purpose of Djangos django.contrib.staticfiles app?
A.
To manage static files in development
B.
To provide a static file server in production
C.
To collect and serve static files during deployment
D.
To define URL patterns for static files
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 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# :
28
out of 50
Django was initially released in ..................
Django was initially released in ..................
A.
July 2005
July 2005
B.
July 2005
July 2005
C.
July 2005
July 2005
D.
None of above
None of above
Question No# :
29
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# :
30
out of 50
In Django, what is the purpose of the urls.py file in an app?
A.
It contains the database models
B.
It defines the views for the app
C.
It stores configuration settings for the app
D.
It handles user authentication
Question No# :
31
out of 50
How can you handle database transactions in Django views?
A.
By manually committing or rolling back transactions using commit() and rollback()
B.
By using the transaction.atomic decorator or context manager
C.
By setting the AUTOCOMMIT variable in the projects settings
D.
Django handles transactions automatically; no explicit handling is required
Question No# :
32
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# :
33
out of 50
What is the role of the Django middleware in a Django project?
A.
To define URL patterns
B.
To handle user authentication
C.
To process requests and responses globally before reaching views
D.
To manage static files
Question No# :
34
out of 50
How can you handle static files in Django during development?
A.
By manually copying them to a static directory
B.
By using the staticfiles app
C.
By including them in the urls.py file
D.
Static files are not supported in Django
Question No# :
35
out of 50
How can you use Djangos cache framework to store and retrieve cached data?
A.
By directly using the cache module in Python code
B.
By including a cache app in the Django project
C.
By using the cache template tag in HTML
D.
By setting the CACHE variable in the projects settings
Question No# :
36
out of 50
What is Djangos django.contrib.auth.models.Permission model used for?
A.
To store information about user permissions
B.
To define URL patterns for permissions
C.
To manage static files for permissions
D.
Permissions are not supported in Django
Question No# :
37
out of 50
Which Django command is used to apply migrations and update the database schema?
A.
migrate
B.
update
C.
syncdb
D.
applymigrations
Question No# :
38
out of 50
Which command is used to start the development server in Django?
A.
runserver
B.
startserver
C.
devserver
D.
initserver
Question No# :
39
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# :
40
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# :
41
out of 50
What is Djangos django.contrib.messages app used for?
A.
To define URL patterns for messages
B.
To handle user authentication through messages
C.
To send messages between views and templates
D.
To manage static files for messages
Question No# :
42
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# :
43
out of 50
In Django, what is the function of the django-admin.py script?
A.
It starts the Django development server
B.
It creates a new Django app
C.
It is used for administrative tasks and management commands
D.
It defines URL patterns for the admin interface
Question No# :
44
out of 50
MVT Stands for?
MVT Stands for?
A.
Model-View-Template
Model-View-Template
B.
Model-View-Table
Model-View-Table
C.
Map-View-Template
Map-View-Template
D.
Main-View-Template
Main-View-Template
Question No# :
45
out of 50
How can you customize the default Django admin site?
A.
By modifying the admin.py file in each app
B.
By subclassing and customizing the AdminSite class
C.
By using the @admin.site.register decorator
D.
Customization is not possible in the Django admin site
Question No# :
46
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# :
47
out of 50
What does Djangos STATIC_ROOT setting define in a project?
A.
It defines the root URL pattern for static files
B.
It specifies the path to collect static files during deployment
C.
It configures the location of the database file
D.
It sets the expiration time for static files
Question No# :
48
out of 50
What is the purpose of Djangos manage.py script?
A.
To start the development server
B.
To manage database migrations
C.
To create a new Django app
D.
All of the above
Question No# :
49
out of 50
What is the purpose of Djangos settings.py file?
A.
It defines the database models
B.
It contains URL patterns
C.
It stores configuration settings for a Django project
D.
It defines the views for the app
Question No# :
50
out of 50
What are the features of Django web framework?
What are the features of Django web framework?
A.
Templating
Templating
B.
Form handling
Form handling
C.
Admin Interface (CRUD)
Admin Interface (CRUD)
D.
All of the above
All of the above
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