Module Quiz: Views Quiz Answers

In this article i am gone to share Django Web Framework by Meta | Module Quiz: Views Quiz Answers with you..

Enroll Link: Django Web Framework

Module Quiz: Views Quiz Answers

Question 1)
To add a URL pattern with regex, you use the re_path() function instead of the path() function.

  • True
  • False

Question 2)
Which of the following sentences about the path() function is correct? Select all that apply.

  • The URL string parameter of the path() function captures query parameters from the URL.
  • The path() function returns the path of the Django app.
  • The path() function is defined in the django.urls module.
  • The path() function is used to define a URL pattern.

Question 3)
Complete the sentence. The path converters capture _____ from the URL.

  • Path parameters
  • Query parameters
  • URL parameters
  • Body parameters.

Question 4)
The request.user attribute contains the information of the current user.

  • True
  • False

Question 5)
Complete the following sentence. The HTTP status code starting with 5 implies that:

  • The server has encountered an error.
  • The action has been successfully completed.
  • There is a client-side error.
  • The request has been received and is under process.

Question 6)
What are the important features of a class-based view? Select all that apply.

  • A class-based view implements different methods for each HTTP method.
  • The as_view() method maps a URL to a class-based view.
  • Class-based views are reusable.
  • A class-based view subclasses the django.view.View base class.

Question 7)
The Http404 response is a convenient alternative for an HttpResponse.

  • True
  • False

Question 8)
Complete the following sentence. The URL name is _______________.

Select all that apply.

  • used by the reverse() function to fetch the URL mapped with the view function.
  • used to define URL namespace.
  • an optional parameter passed inside the path() function.
  • passed as the name parameter in the path() function.

Question 9)
Can you define views in the file in the projects folder?

  • Yes
  • No

Question 10)
Complete the following sentence. To override the default error view, _______________.

Select all that apply.

  • specify the appropriate handler in the project’s URLConf.
  • you should define the custom error handler view in the app’s file.
  • there’s no need to override the default error views.
  • define the custom view in the project folder.



Leave a Comment