wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Django #1 (basic)

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What happens when url.py file is edited while the development server is still running?

a)

Development server terminates.

b)

The development server automatically restarts.

c)

The development server does nothing.

d)

The web page is automatically reloaded.

e)

I don't know it

2.

Which setting contains the parameter of main-urls file?

a)

ROOT_URLCONF

b)

MAIN_URLCONF

c)

STATIC_URL

d)

MEDIA_URL

e)

I don't know it

3.

Django is based on which framework?

a)

MVC

b)

MVVM

c)

MVT

d)

None of the above

e)

I don't know it

4.

What is the purpose of __init__.py in project directories?

a)

It allows Python to recognise the folder as package.

b)

It is useless and can be deleted.

c)

It is used to initialise any empty values.

d)

None of the above

e)

I don't know it

5.

Which method is used instead of path() in urls.py to pass in regular expressions as routes?

a)

static()

b)

re_path()

c)

include()

d)

url()

e)

I don't know it

6.

What happens if, from the given list, I searched for urlpatterns registration/ skipping the trailing/slash?

a)

Django will give a 404-error page.

b)

Django will match registration/ pattern.

c)

None of the above

d)

I don't know it

7.

What is the use of os.path.dirname(__file__) in this method?

a)

It is the default value and points to Django settings.py.

b)

It is passing some value defined before.

c)

It is used to pass the value of current file in which this line is written.

d)

None of the above

e)

I don't know it

8.

What is a virtual environment?

a)

A directory for saving packages

b)

An isolated space of global environment to work with python

c)

A framework

d)

An important phase of development

e)

I don't know it

9.

What is the value of DEBUG when website is online/ or deployed?

a)

False

b)

True

c)

None

d)

Null

e)

I don't know it

10.

What does {{ name }} this mean in Django Templates?

a)

It will be displayed as name in HTML.

b)

The name will be replaced with values of Python variable.

c)

{{ name }} will be the output.

d)

None of the above

e)

I don't know it

11.

What is this setting for?

a)

This setting is used for Database Caching.

b)

This setting is used for Caching.

c)

It will store Cache in table dataflair_cache.

d)

All of the above

e)

I don't know it

12.

Check in-valid template tag.

a)

{% If %}/{% else %}

b)

{% ifequal %}

c)

{% while %}

d)

{% for key in dictionary %}

e)

I don't know it

13.

What will this template generate

a)

Error-invalid syntax

b)

An iterator in list

c)

Logic does not run

d)

None of the above

e)

I don't know it

14.

What does {{ forloop.counter }} prints?

a)

It will not print if for loop variable is not defined.

b)

It will count the number of times loop ran.

c)

It prints the integer value of no. of times the loop executed.

d)

None of the above

e)

I don't know it

15.

This template {# #} is used for?

a)

It is comment in template language.

b)

It is used for business logic.

c)

It will raise an exception.

d)

None of the above

e)

I don't know it