Building Web Applications in Django | Week 1

Course Name: Django for Everybody

Sub-course: Building Web Applications in Django

Course Link: Django for Everybody

Sub-course Link: Building Web Applications in Django

These are Building Web Applications in Django Week 1 answers Coursera Quiz


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?

  • PostgreSQL
  • MySQL
  • MongoDB
  • sqlite3
  • Oracle

Answer: sqlite3


Q2. What file contains the list of INSTALLED_APPS in a Django project?

  • urls.py
  • manage.py
  • views.py
  • apps.py
  • settings.py

Answer: settings.py


These are Building Web Applications in Django Week 1 Answers Coursera Quiz


Q3. What does the “python manage.py migrate” command do?

  • Makes a backup copy of db.sqlite3
  • Builds/updates the database structure for the project
  • Moves login sessions to the backing store
  • Moves the application to a new server

Answer: Builds/updates the database structure for the project


Q4. What is the purpose of the models.py file?

  • To apply a regular expression to the incoming path in the request object
  • To make building views for your application simpler
  • To connect your database to the Django administration interface
  • To define the shape of the data objects to be stored in a database

Answer: To define the shape of the data objects to be stored in a database


These are Building Web Applications in Django Week 1 Answers Coursera Quiz


Q5. What does the “sqlmigrate” option accomplish in a Django application?

  • It moves all of your non-SQL data into flat files
  • It builds/updates the database structure for the project
  • It copies all of your SQL into a REST-based API
  • It lets you see the SQL that will run to effect a migration
See also  Web Application Technologies and Django | Week 2

Answer: It lets you see the SQL that will run to effect a migration


Q6. What does the str method in a Django model accomplish?

  • It lets you specify how an instance of the model will be represented as a string
  • It indicates how strict the storage model will be in terms of column length
  • It improves the strength of the binding between SQL and the model
  • It determines how the model will respond to stress

Answer: It lets you specify how an instance of the model will be represented as a string


These are Building Web Applications in Django Week 1 Answers Coursera Quiz


Q7. What is the difference between the Django shell and a normal interactive Python shell?

  • The Django shell loads all of the project objects before starting
  • Only the Python shell can print values
  • You can run Django commands in a Python shell
  • The Django shell uses JavaScript instead of Python

Answer: The Django shell loads all of the project objects before starting


Q8. What is the Django command to create a user/password for the admin user interface?

  • //SYSIN DD USER
  • MOVE CORRESPONDING INTO USER
  • createsuperuser
  • INSERT INTO User;

Answer: createsuperuser


These are Building Web Applications in Django Week 1 Answers Coursera Quiz


Q9. What file in a Django application do you edit to make sure a model appears in the admin interface?

  • admin.py
  • module.py
  • sakaiger.py
  • views.py

Answer: admin.py


Model View Controller

Q1. Which of these might you find in the View of a Django MVC application?

  • HTML
  • SQL
  • Python
  • PHP

Answer: HTML


Q2. Which of these might you find in the Model of a Django MVC application?

  • HTML
  • SQL
  • Python
  • PHP
See also  Using JavaScript and JSON in Django | Week 3

Answer: SQL


These are Building Web Applications in Django Week 1 Answers Coursera Quiz


Q3. Which of these might you find in the Controller of a Django MVC application?

  • HTML
  • SQL
  • Python
  • PHP

Answer: Python


Q4. Which of the following is typically the first task when handing an incoming HTTP request in web server code?

  • Handle check the input data
  • Store the input data
  • Retrieve any needed data for the View
  • Produce and return the HTTP Response

Answer: Handle check the input data


These are Building Web Applications in Django Week 1 Answers Coursera Quiz


Q5. Which of the following files does Django consult first when it receives an incoming HTTP Request?

  • urls.py
  • views.py
  • models.py
  • forms.py
  • templates/polls/main.html

Answer: urls.py


Q6. Which of the following files in a Django application most closely captures the notion of “View”?

  • urls.py
  • views.py
  • models.py
  • forms.py
  • templates/polls/main.html

Answer: templates/polls/main.html


These are Building Web Applications in Django Week 1 Answers Coursera Quiz


Q7. Which file represents the “Controller” aspect of a Django application?

  • views.py
  • models.py
  • More than one file
  • forms.py

Answer: More than one file


These are Building Web Applications in Django Week 1 Answers Coursera Quiz


More Weeks of this course: Click Here

More Coursera Courses: http://progiez.com/coursera


These are Building Web Applications in Django Week 1 Answers Coursera Quiz