Get All Weeks Building Web Applications in Django Coursera Quiz Answers
Table of Contents
Week 01: Building Web Applications in Django Coursera Quiz Answers
Quiz 1: Django Tutorial Part 2
Q1. These questions come from the Django project tutorial materials.
What is the default database backend for Django projects when they are first set up?
ViewQ2. What file contains the list of INSTALLED_APPS in a Django project?
ViewQ3. What does the “python manage.py migrate” command do?
ViewQ4. What is the purpose of the models.py file?
ViewQ5. What does the “sqlmigrate” option accomplish in a Django application?
ViewQ6. What does the str method in a Django model accomplish?
ViewQ7. What is the difference between the Django shell and a normal interactive Python shell?
ViewQ8. What is the Django command to create a user/password for the admin user interface?
ViewQ9. What file in a Django application do you edit to make sure a model appears in the admin interface?
ViewQuiz 2: Model View Controller
Q1. Which of these might you find in the View of a Django MVC application?
View2.Python
Q2. Which of these might you find in the Model of a Django MVC application?
View2.Python
Q3. Which of these might you find in the Controller of a Django MVC application?
ViewQ4. Which of the following is typically the first task when handing an incoming HTTP request in web server code?
ViewQ5. Which of the following files does Django consult first when it receives an incoming HTTP Request?
ViewQ6. Which of the following files in a Django application most closely captures the notion of “View”?
ViewQ7. Which file represents the “Controller” aspect of a Django application?
View2.views.py
Week 2: Building Web Applications in Django Coursera Quiz Answers
Quiz 1: Templates and Views
Q1. What does the built-in Django template tag “lorem” do?
ViewQ2. What does the built-in Django template tag “spaceless” do?
ViewQ3. What does the built-in Django template tag “url” do?
ViewQ4. What built-in Django template filter capitalizes the first character of the value?
ViewQ5. What does the built-in Django template filter “length” do?
ViewQ6. What does the built-in Django template filter “safe” do?
ViewQ7. Looking at the Django built-in template and filter documentation, the author seems to have a pet named “Joel”. What kind of animal is their pet?
ViewQ8. What does the Django built-in template tag forloop.counter represent in a Django template?
ViewQuiz 2: Tutorial 3
Q1. These questions come from the Django project tutorial materials.
When do you see a path with the following pattern in urls.py, path(‘/’, views. detail, name=’detail’),
where in the code does the question_id value parsed from the URL end up?
ViewQ2. What kind of data is passed into a view in the ‘request’ object?
ViewQ3. Which of the following SQL commands will be run by the Question.objects.values() statement in a view function?
ViewQ4. How do you indicate that a particular question cannot be found in a detail view?
ViewQ5. How do you retrieve only the first five objects in a table using a Django model query?
ViewQ6. In Django, why do we add an extra folder (i.e., namespace) our templates?
ViewQ7. What is the difference between a list view and detail view?
ViewQ8. What is a “404” error?
ViewQ9. In Django, what is the default language used in HMTL template files?
ViewQ10. If the “get_object_or_404()” helper function finds the requested item, it returns the item. What happens if it cannot return the item?
ViewQ11. Why do we name space URL names using the “app_name” variable in the urls.py file?
ViewWeek 3: Building Web Applications in Django Coursera Quiz Answers
Quiz 1: Object-Oriented Python
Q1. Which came first, the instance or the class?
ViewQ2. In Object Oriented Programming, what is another name for the attributes of an object?
ViewQ3. Which of the following is NOT a good synonym for “class” in Python?
ViewQ4. What does this Python statement do if PartyAnimal is a class?
Viewzap = PartyAnimal()
Q5. What is the syntax to look up the fullname attribute in an object stored in the variable colleen?
ViewQ6. Which of the following statements are used to indicate that class A will inherit all the features of class B?
ViewQ7. What is “self” typically used for in a Python method within a class?
ViewQ8. What does the Python dir() function show when we pass an object into it as a parameter?
ViewQ9. Which of the following is rarely used in Object Oriented Programming?
ViewQuiz 2: Generic Views
Q1. In the class django.views.generic.list.ListView, which of the following methods is called earliest in the process?
ViewQ2. In the class django.views.generic.list.ListView, which of the following methods is called latest in the process?
ViewQ3. In the class django.views.generic.detail.DetailView, which of the following methods is called earliest in the process?
ViewQ4. In the class django.views.generic.detail.DetailView, which of the following methods is called latest in the process?
ViewQ5. By convention when using an app_name of “abc” and a model of “Dog”, if you use a View that extends django.views.generic.detail.DetailView, what is the file name that will be used for the template?
ViewQ6. If you want to override the template name chosen by convention in a View that extends django.views.generic.detail.DetailView, what is the name of the class attribute variable that you use?
ViewQ7. By convention when using an app_name of “abc” and a model of “Dog”, if you use a View that extends django.views.generic.list.ListView, what is the name of the context variable that will include all the Dog objects in the template when it is being rendered?
ViewQ8. For the following line in a views.py file
Viewclass ArticleListView(ListView):
what is the best description of “ListView”?
Q9. For the following line in a views.py file
Viewclass ArticleListView(ListView):
what is the best description of “ArticleListView”?
Q10. For the following line in a urls.py file
Viewurlpatterns = [
path('', TemplateView.as_view(template_name='gview/main.html'))
where would you find the actual code for TemplateView?
Week 4: Building Web Applications in Django Coursera Quiz Answers
Quiz 1: Tutorial 4
Q1. These questions come from the Django project tutorial materials.
What is stored in the variable request.POST?
ViewQ2. What does the django.urls.reverse() function do?
ViewQ3. What happens if you access a detail view like results() in Django tutorial 4 and provide a key that does not exist on the URL?
ViewQ4. In the polls/templates/polls/detail.html file in Django tutorial 4, what happens if you leave out the csrf_token line in the form?
ViewQ5. In the polls/templates/polls/detail.html file in Django tutorial 4, which bit of code tells the view that will receive the POST data which question to associate this vote with?
ViewQ6. Which HTTP method is used when sending data to the server that will modify or update data?
ViewQ7. What does the Django template filter “pluralize” do?
ViewQuiz 2: Forms and HTML
Q1. Which of the following HTTP methods adds form data to the URL after a question mark?
ViewQ2. Which of the following HTTP methods is recommended for sending data to the server that will modify a model?
ViewQ3. Which of the following Python types is most like the request.POST data in Django?
ViewQ4. How does the browser send form data to the server when sending a POST request?
ViewQ5. When using the password field type in HTML, the data is encrypted before it is sent to the server.
ViewQ6. There is no way the end user can see the actual data stored in a password form field.
ViewQ7. How do radio buttons in HTML associate with each other?
ViewQ8. What HTTP response code is sent to a browser when a missing or incorrect CSRF value is detected by Django?
ViewQ9. What HTTP code is sent to the browser to redirect it to another page?
ViewQ10. Why do we consider the POST-Redirect-GET pattern best practice?
ViewGet All Course Quiz Answers of Django for Everybody’s Specialization
Web Application Technologies and Django Quiz Answers
Building Web Applications in Django Coursera Quiz Answers
Django Features and Libraries Coursera Quiz Answers
Using JavaScript, JQuery, and JSON in Django Coursera Quiz Answers