Which of the following sentences about templates are true? Select all that apply.
A template is a web page that has blocks of template language syntax inside the HTML script.
A template extracts the data from a model and generates a dynamic page.
A template helps to include conditional processing logic in a web page.
A template is the data layer of the application.
The view function loads a template and fills the context data in it.
True
False
Which of the following tags are used for implementing template inheritance? Select all that apply.
{% extends %}
{% include %}
{% block %}
{% endfor %}
True or false. To implement template inheritance, the parent template must have the name
base.html
.True
False
In which module is the
render()
function defined?django.urls
django.shortcuts
django.db
django.contrib
Which of the following template filters returns a
titlecase
representation of a string?Hint: titlecase makes words start with an uppercase character and the remaining characters lowercase.
upper
lower
title
length
Putting one loop inside another is called nesting of loops. Can you use nested loops in a template?
Yes
No
Complete the sentence. The view function passes a ______ as the context data to a template.
Python list
Python string
Python dict
Python tuple
What are the advantages of a class-based view? Select all that apply.
Code reusability
Extensible code
Class-based views are simple to implement
Implicit code flow
Suppose that a Django app named
myapp
has the Employee model. Which of the following statements about the genericListView
class are correct? Select all that apply.A generic
ListView
class must be namedEmployeeList
A generic
ListView
class should set the model attribute tomyapp_Employee
A generic
ListView
class lists all the rows in theEmployee
tableA generic
ListView
class needs a template namedEmployeeList.html