NEW
Font size
WorksheetsDjango #1 (basic)
Total questions: 15
Worksheet time: 8mins
What happens when url.py file is edited while the development server is still running?
Development server terminates.
The development server automatically restarts.
The development server does nothing.
The web page is automatically reloaded.
I don't know it
Which setting contains the parameter of main-urls file?
ROOT_URLCONF
MAIN_URLCONF
STATIC_URL
MEDIA_URL
I don't know it
Django is based on which framework?
MVC
MVVM
MVT
None of the above
I don't know it
What is the purpose of __init__.py in project directories?
It allows Python to recognise the folder as package.
It is useless and can be deleted.
It is used to initialise any empty values.
None of the above
I don't know it
Which method is used instead of path() in urls.py to pass in regular expressions as routes?
static()
re_path()
include()
url()
I don't know it
What happens if, from the given list, I searched for urlpatterns registration/ skipping the trailing/slash?
Django will give a 404-error page.
Django will match registration/ pattern.
None of the above
I don't know it
What is the use of os.path.dirname(__file__) in this method?
It is the default value and points to Django settings.py.
It is passing some value defined before.
It is used to pass the value of current file in which this line is written.
None of the above
I don't know it
What is a virtual environment?
A directory for saving packages
An isolated space of global environment to work with python
A framework
An important phase of development
I don't know it
What is the value of DEBUG when website is online/ or deployed?
False
True
None
Null
I don't know it
What does {{ name }} this mean in Django Templates?
It will be displayed as name in HTML.
The name will be replaced with values of Python variable.
{{ name }} will be the output.
None of the above
I don't know it
What is this setting for?
This setting is used for Database Caching.
This setting is used for Caching.
It will store Cache in table dataflair_cache.
All of the above
I don't know it
Check in-valid template tag.
{% If %}/{% else %}
{% ifequal %}
{% while %}
{% for key in dictionary %}
I don't know it
What will this template generate
Error-invalid syntax
An iterator in list
Logic does not run
None of the above
I don't know it
What does {{ forloop.counter }} prints?
It will not print if for loop variable is not defined.
It will count the number of times loop ran.
It prints the integer value of no. of times the loop executed.
None of the above
I don't know it
This template {# #} is used for?
It is comment in template language.
It is used for business logic.
It will raise an exception.
None of the above
I don't know it
