Django

Django Practice Test

0%

In the fall of what year was Django created?

Correct! Wrong!

Correct answer: 2003

Adrian Holovaty and Simon Willison started the Lawrence Journal-World as an internal project.

What is MVT stand for?

Correct! Wrong!

Correct answer: Model-View-Template

The Model-View-Template or MVT differs from MVC in a few aspects. The template is composed of HTML and Django Template Language (DTL).

Which of the following can be a view response?

Correct! Wrong!

Correct answer: All of the above

The HTML content of a Web page, a redirect, a 404 error, an XML document, or an image are all types of view responses.

Django is a Python web framework with a _______________.

Correct! Wrong!

Correct answer: high-level

Django is a high-level Python web framework that promotes quick development and clean, practical design.

If you need to deploy your project using WSGI, which of the following is used?

Correct! Wrong!

Correct answer: wsgi.py

If you need to deploy your project using WSGI, use wsgi.py.

In Django, how many various kinds of HTTP requests are there?

Correct! Wrong!

Correct answer: 2

GET and POST are the two kinds of HTTP requests.

In Django, a variable appears as __________________.

Correct! Wrong!

Correct answer: {{variable}}

A variable appears like {{variable}}.

What features does the Django web framework have?

Correct! Wrong!

Correct answer: All of the above

Django's web framework has all of these features.

There are _____________ components to the MVC pattern.

Correct! Wrong!

Correct answer: three

There are three components to the MVC pattern. Model, View, and Controller.

What are some valid Django Template System forloop attributes?

Correct! Wrong!

Correct answer: forloop.counter

Django Template System's forloop.counter is a valid forloop attribute.

What is the best way to exclude a specific field from a ModelForm?

Correct! Wrong!

Correct answer: Use the exclude parameter in the Meta class in your form

To exclude a specific field from a ModelForm, use the exclude parameter in the Meta class in your form.

In production, which of the following is not utilized as a Django server?

Correct! Wrong!

Correct answer: Ansible

In production, Ansible cannot be used as a Django server.

In Django admin, which attribute is applied to order the objects?

Correct! Wrong!

Correct answer: ordering

In Django admin, ordering is used to order the objects.

The current input as well as the previous output states determine the output of a circuit. ___________________ is the term given to the circuit.

Correct! Wrong!

Correct answer: Sequential circuit

A sequential circuit is what this circuit is called.

What happens if you make changes to the url.py file while the development server is still running?

Correct! Wrong!

Correct answer: The development server automatically restarts.

When the url.py file is changed while the development server is running, the development server restarts automatically.

What is the purpose of the {# #} template?

Correct! Wrong!

Correct answer: It is comment in template language.

In template language, {# #} represents a comment.

In urls.py, what method is used instead of path() to pass regular expressions as routes?

Correct! Wrong!

Correct answer: url()

Regular expressions are passed in as routes using url().

In Django, what is the default time zone?

Correct! Wrong!

Correct answer: America/Chicago

Django's default time zone setting is America/Chicago.

What is a small template that contains details from the current object?

Correct! Wrong!

Correct answer: Inclusion tags

Inclusion tags are a small template that contains information about the current object.

Which of the following is a method for preventing Denial of Service attacks?

Correct! Wrong!

Correct answer: Traffic filtering

Traffic filtering is a method for preventing Denial of Service attacks.

What is Django's default caching mechanism?

Correct! Wrong!

Correct answer: simple

Django's default caching mechanism is simple.

Which of the following is a typical web server flaw?

Correct! Wrong!

Correct answer: Default installation

The default installation is a common web server vulnerability.

What Django command should you use to see the database of an existing or legacy?

Correct! Wrong!

Correct answer: manage.py inspectdb

The command manage.py inspectdb may be used to view the database of an existing or legacy.

What does settings.py do?

Correct! Wrong!

Correct answer: It's used to configure settings for the Django project

The command settings.py is used to configure Django project settings.

How would you get all of the User records from a database in Django?

Correct! Wrong!

Correct answer: User.objects.all()

User.objects.all() can be used to get all the user records from a database.

___________________ was the one who first introduced Django.

Correct! Wrong!

Correct answer: Adrian Holovaty

Django was introduced by Adrian Holovaty.

What language is Django written in?

Correct! Wrong!

Correct answer: Python

Django is written in the Python programming language.

What method do you add to a Django model to improve the model's string representation in the Django admin?

Correct! Wrong!

Correct answer: __unicode__

To achieve a better string representation of the model in the Django admin, add __unicode__.

What is the function of the Django command "manage.py validate"?

Correct! Wrong!

Correct answer: Checks your models for errors.

To check for errors in your models, use the command manage.py validate.

When DEBUG is set to _______________ in settings.py, Django will email unhandled exceptional conditions.

Correct! Wrong!

Correct answer: False

When False is set in settings.py, Django will email unhandled exceptional conditions.