Project Functionality Quiz Answers
In this article i am gone to share Coursera Course: Back-End Developer Capstone by Meta Week 2 | Project Functionality Quiz Answers with you..
Also visit: Starting the Project Quiz Answers
Project Functionality Quiz Answers
Question 1)
Which of the following is the default port number for MySQL Server?
- 3336
- 3306
- 3746
- 8008
Question 2)
Which of the following handles invalid or missing values from being stored in the database?
- SET sql_mode=’PASS_TRANS_TABLES’
- SET sql_mode=’STATIC_TRANS_TABLES’
- SET sql_mode=’STRICT_TRANS_TABLES’
- SET sql_mode=’DYNAMIC_TRANS_TABLES’
Question 3)
Which of the following databases are officially supported by Django? Select all that apply.
- Redis
- MongoDB
- Oracle
- SQLite
- MySQL
Question 4)
Which of the following statements about a model in Django is correct? Select all that apply.
- A model is a Python class that extends the Model class in the django.db.models module.
- A model optionally uses Meta as an inner class.
- A model is the single, definitive source of information about your data in a Django project.
- A model defines the class attributes of int or str data type.
Question 5)
DRF converts model instances into what format?
- JSON
- API
- XML
- HTML
Question 6)
Suppose we created a class which inherits from ListCreateView class, which two HTTP methods would be supported?
- GET
- PATCH
- POST
- DELETE
Question 7)
The process of ________ involves converting the model instances to native Python data types.
- serialization
- denormalizing
- deserializing
- normalizing
Question 8)
True or False: Django applications can be configured to handle multiple databases.
- True
- False
Question 9)
DRF views can be which of the following? Select all that apply.
- mixins
- generic view classes
- generic write classes
- module-based
Question 10)
This is a special type of serializer which quickly creates a serializer class from Django model fields.
- JsonSerializer
- MenuSerializer
- ModelSerializer
Question 11)
In the settings.py file, what does the init_command option in the DATABASES configuration do?
- Initiates the communication between the Django server and the database server.
- This option initializes the database.
- This is the initial command to issue to the server upon connection.
- This option initializes the connection to the database.
Question 12)
If we want to use another type of database instead of SQLite we must change the DATABASES configuration in the _________ file.
- models.py
- modelSettings.py
- py.models
- settings.py
Question 13)
Which of the following will register the Menu model inside of your admin.py file?
site.admin(Menu)- admin.site(Menu)
- site.admin.register(Menu)
- admin.site.register(Menu)
Question 14)
Which of the following statements are true regarding the differences between a Django API and a Django web application? Select all that apply.
- The Django framework has built-in support for building a web application and APIs.
- An API is a service used by any HTTP client, while a Django web application interacts mainly with a browser client.
- An API returns a JSON or XML response to the client, while a Django web application usually returns an HTML response.
- The API needs user authentication, while the Django web application doesn’t have the provision of authentication.
Question 15)
Which of the following parameters define the maximum lifetime of a connection?
OPTIONS- CONN_MAX_AGE
AUTOCOMMIT- CONN_MAX_LIFE
Question 16)
True or False: Using DRF we can quickly create API’s thanks to the built-in modules and classes.
- True
- False
Question 17)
Which of the following starts the MySQL command line client?
- mysql -u root -p
- mysql -start
- mysql -p root -u
- root -p mysql -u
Question 18)
Which of the following commands is used to enable or disable Django’s transaction management?
- OPTIONS
- CONN_MAX_AGE
- ENGINE
- AUTOCOMMIT
Question 19)
Select the two types of data the Serializer in DRF converts to.
- XML
- GraphQL
- JSON
- HTML
Question 20)
The process of ________ involves converting the native Python datatypes into model instances.
denormalizing- normalizing
- deserialization
- serializing
Question 21)
We have an app named dealership, and a model class named Car. If we migrate these to create a mapped table, what will Django name the table?
- car
- CAR
- Car
- restaurant_car
Question 1)
Which of the following is the proper syntax to run the migrate command?
migrate python manage.py- python manage.py migrate
- python migrate manage.py
pip3 manage.py migrate
Question 6)
Suppose we created a class which inherits both RetrieveUpdateAPIView and DestroyAPIView classes, which three HTTP methods will be supported?
- PATCH
- DELETE
- POST
- GET
- PUT
Question 7)
True or False: When using DRF you can use the DefaultRouter class to wire up API URL’s instead of declaring routes in the app and including them in the project’s URLConf.
- True
- False
Question 9)
Select two generic view classes in Django REST Framework?
- RetrieveUpdateAPIView
- TemplateView
- ListCreateAPIView
- DetailView
Question 3)
Django places app-specific models in the ________ file in the app package folder.
- py.models
- modelSettings.py
- models.py
- settings.py
Question 10)
Which module contains both RetrieveUpdateApiView and DestroyAPIView classes?
rest_framework.serializers- rest_framework.generics
- rest_framework.mixins
Question 5)
Which file contains the INSTALLED_APPS for our application?
- models.py
- modelSettings.py
- py.models
- settings.py
Question 9)
What is one advantage of using ViewSets in Django REST Framework?
- Using one ViewSet we can handle all types of HTTP requests.
- It automatically serializes the queryset.
- It automatically enforces authentication.
- Views based on ViewSets are more concise and help to keep logic organized.
In the settings . py file, what does the init command option in the DATABASES configuration do?
1. Initiates the communication between the Django server and the database server.
2. This is the initial command to issue to the server upon connection.
3. This option initializes the connection to the database.
4. This option initializes the database.
Option 2. is correct..!
2. This is the initial command to issue to the server upon connection.