Online Exam Quiz

questionQuestion  1 to 30

Which of the following is a valid Django template filter?

  • {{ name
  • lower }}
  • {{ name
  • capitalize }}
Mark for review

What is the purpose of Django's settings.py file?

  • To define the URL patterns
  • To define the models
  • To configure the application settings
  • To define the views
Mark for review

What is Django?

  • A Python library
  • A Python framework
  • A Python interpreter
  • A Python IDE
Mark for review

Which command is used to run Django's development server?

  • python manage.py runserver
  • python manage.py startserver
  • python manage.py devserver
  • python manage.py server
Mark for review

Which of the following is a valid HTTP status code?

  • 200
  • 700
  • 800
  • 900
Mark for review

What is the purpose of Django's reverse function?

  • To reverse a string
  • To reverse a list
  • To reverse a URL pattern
  • To reverse a dictionary
Mark for review

What is the purpose of Django's admin.py file?

  • To configure admin-related settings
  • To define admin users
  • To register models for the admin interface
  • To configure the admin URL patterns
Mark for review

How do you add a URL pattern in Django?

  • Using a dictionary
  • Using a list
  • Using a tuple
  • Using a function
Mark for review

What does ORM stand for in Django?

  • Object-Relational Mapping
  • Object-Retrieval Method
  • Object-Reference Model
  • Object-Relational Model
Mark for review

What is the purpose of Django's views.py file?

  • To configure the application settings
  • To define the URL patterns
  • To define the business logic for the application
  • To create and handle database models
Mark for review

What is the purpose of Django's models.py file?

  • To define the URL patterns
  • To configure the application settings
  • To define database models
  • To handle HTTP requests
Mark for review

Which of the following is a valid Django management command?

  • python manage.py runserver
  • python manage.py startserver
  • python manage.py devserver
  • python manage.py server
Mark for review

What is the purpose of Django's STATIC_URL setting?

  • To define the URL for static files
  • To define the URL for media files
  • To define the URL for templates
  • To define the URL for admin files
Mark for review

What is the purpose of Django's request.user attribute?

  • To access the current user
  • To access the current request
  • To access the current session
  • To access the current response
Mark for review

Which of the following is a valid Django model field type for a date?

  • DateField
  • TimeField
  • DateTimeField
  • All of the above
Mark for review

Which function is used to render a template in Django?

  • render_to_template
  • render
  • render_template
  • template_render
Mark for review

What is the purpose of Django's get_object_or_404 function?

  • To get an object from the database or return a 404 error
  • To get a form from the database
  • To get a view from the database
  • To get a URL from the database
Mark for review

Which of the following is not a valid HTTP method in Django views?

  • GET
  • POST
  • FETCH
  • DELETE
Mark for review

What is the purpose of Django's request.method attribute?

  • To check the HTTP method of the request
  • To check the HTTP status of the request
  • To check the HTTP headers of the request
  • To check the HTTP body of the request
Mark for review

Which command is used to collect static files in Django?

  • python manage.py collectstatic
  • python manage.py gatherstatic
  • python manage.py staticcollect
  • python manage.py gatherfiles
Mark for review

What is the use of the migrate command in Django?

  • To create a new database
  • To create new models
  • To apply and synchronize database migrations
  • To rollback database changes
Mark for review

Which of the following is a valid Django model field option?

  • max_length
  • min_length
  • max_value
  • min_value
Mark for review

What is the purpose of Django's request.GET attribute?

  • To access query parameters
  • To access form data
  • To access uploaded files
  • To access session data
Mark for review

Which command is used to create database migrations in Django?

  • python manage.py migrate
  • python manage.py makemigrations
  • python manage.py syncdb
  • python manage.py createdb
Mark for review

Which middleware class is used to enable sessions in Django?

  • SessionMiddleware
  • CacheMiddleware
  • CommonMiddleware
  • SecurityMiddleware
Mark for review

How do you access form data in Django views?

  • Using request.POST
  • Using request.GET
  • Using request.FORM
  • Using request.DATA
Mark for review

Which command is used to create a new Django application?

  • django-admin createapp
  • django createapp
  • django-admin startapp
  • django startapp
Mark for review

Which of the following is a valid Django model method?

  • str
  • unicode
  • repr
  • init
Mark for review

Which command is used to start a new Django project?

  • django-admin startproject
  • django startproject
  • django-admin newproject
  • django newproject
Mark for review

What is the purpose of the manage.py file in Django?

  • To manage database migrations
  • To manage project settings
  • To manage project applications
  • To manage all administrative tasks
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review