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
Which of the following are Advantages of Django?
Which of the following are Advantages of Django?
A.
Object-Relational Mapping (ORM) Support
Object-Relational Mapping (ORM) Support
B.
Multilingual Support
Multilingual Support
C.
Administration GUI
Administration GUI
D.
Framework Support
Framework Support
Question No# :
02
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# :
03
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# :
04
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# :
05
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# :
06
out of 50
What is Django?
A.
A programming language
B.
A web framework for Python
C.
A database management system
D.
A JavaScript library
Question No# :
07
out of 50
In Django, what is the purpose of the HEAD request method?
A.
It retrieves data from the server
B.
It updates existing data on the server
C.
It checks whether a resource exists without retrieving the actual data
D.
It is not a valid HTTP request method
Question No# :
08
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# :
09
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# :
10
out of 50
What is the purpose of Djangos django.contrib.messages.storage.session.SessionStorage?
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# :
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 does the Django template tag {% csrf_token %} do?
A.
It defines a new URL pattern
B.
It includes a CSRF token in the form
C.
It imports a CSS file
D.
It defines a new model
Question No# :
13
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# :
14
out of 50
Django is a _____________ Python web framework.
Django is a _____________ Python web framework.
A.
low-level
low-level
B.
mid-level
mid-level
C.
high-level
high-level
D.
None of the above
None of the above
Question No# :
15
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# :
16
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# :
17
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# :
18
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# :
19
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# :
20
out of 50
How can you enable Djangos built-in administration interface (admin site)?
A.
By including the admin app in the projects INSTALLED_APPS
B.
By running the createsuperuser management command
C.
By setting the ADMIN_ENABLED variable in the projects settings
D.
By defining URL patterns for the admin interface
Question No# :
21
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# :
22
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# :
23
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# :
24
out of 50
How can you use Djangos django.contrib.auth.decorators.login_required decorator?
A.
To restrict access to a view to authenticated users
B.
To allow anonymous users to access a view
C.
To define URL patterns for authentication
D.
To create a new user in the database
Question No# :
25
out of 50
What are the Advantages of Django?
What are the Advantages of Django?
A.
It supports Multilingual
It supports Multilingual
B.
It supports the framework
It supports the framework
C.
Administration GUI
Administration GUI
D.
All of the above
All of the above
Question No# :
26
out of 50
What is Djangos csrf_exempt decorator used for?
A.
To exclude a view from CSRF protection
B.
To enforce CSRF protection on a view
C.
To define URL patterns for CSRF requests
D.
To handle user authentication
Question No# :
27
out of 50
Which command is used to create a new Django project?
A.
startproject
B.
createproject
C.
newproject
D.
initproject
Question No# :
28
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# :
29
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# :
30
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# :
31
out of 50
How can you include an apps URLs in the projects urls.py file?
A.
By manually copying and pasting the URLs
B.
By importing the apps views directly
C.
By using the include function
D.
By defining the URLs directly in the projects settings.py file
Question No# :
32
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# :
33
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# :
34
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# :
35
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# :
36
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# :
37
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# :
38
out of 50
What does Djangos django.contrib.auth.views.password_change_done view function do?
A.
It renders the password change form
B.
It handles user authentication for password change
C.
It displays a success message after a successful password change
D.
It defines URL patterns for password change
Question No# :
39
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# :
40
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# :
41
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# :
42
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# :
43
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# :
44
out of 50
How can you use Djangos django.contrib.auth.views.password_change view function?
A.
By including it in the projects urls.py file
B.
By manually creating a URL pattern for password change
C.
By using the {% password_change %} template tag
D.
All of the above
Question No# :
45
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# :
46
out of 50
What is the purpose of Djangos django.contrib.sites app?
A.
To define URL patterns for different sites
B.
To handle user authentication on different sites
C.
To manage multiple sites with a single Django installation
D.
To create separate Django projects for different sites
Question No# :
47
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# :
48
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# :
49
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# :
50
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
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