Django Features and Libraries | Week 2

Course Name: Django for Everybody

Sub-course: Django Features and Libraries

Course Link: Django for Everybody

Sub-course Link: Django Features and Libraries

These are Django Features and Libraries Week 2 Answers Coursera Quiz


Login and Authentication

Q1. Which came first?

  • Session
  • Cookie
  • Login

Answer: Cookie


Q2. Which came second?

  • Cookie
  • Session
  • Login

Answer: Session


These are Django Features and Libraries Week 2 Answers Coursera Quiz


Q3. Which best describes the Django functionality that puts up the login form?

  • Middleware
  • Application
  • Model
  • TemplateTag

Answer: Application


Q4. Which best describes the Django functionality that supports sessions?

  • TemplateTag
  • Application
  • Model
  • Middleware

Answer: Middleware


These are Django Features and Libraries Week 2 Answers Coursera Quiz


Q5. What happens when the user passes a login check?

  • Information is added to the session
  • A new record is added to the auth_user table
  • A cookie is set
  • A new record is added to the auth_group table

Answer: Information is added to the session


Q6. What string is returned by:
x = django.urls.reverse(‘login’)
in dj4e-samples?

  • /dj4e-samples/login
  • nigol
  • /accounts/login
  • /login

Answer: /accounts/login


These are Django Features and Libraries Week 2 Answers Coursera Quiz


Q7. What is the purpose of the next parameter on a login or logout URL?

  • It advances the iteration variable in a for loop
  • It moves to the next item in a linked list
  • It tells the authentication system where to go after the action is complete
  • It indicates which record to start with in a list that exceeds the length of the page

Answer: It tells the authentication system where to go after the action is complete


Q8. What is the value in a Django template to print out the current logged-in user’s email address?

  • user.address
  • user.email
  • user.rmail
  • user.info.address.email
See also  Building Web Applications in Django | Week 3

Answer: user.email


These are Django Features and Libraries Week 2 Answers Coursera Quiz


Q9. In a Django template, what is stored in the request.path variable?

  • The URL of the currently executing request
  • The actual table name of the model that is currently in use
  • A string indicating the path to the ‘parent’ folder
  • A list of breadcrumbs of recently visited URLs

Answer: The URL of the currently executing request


Q10. What is the default name of the template that Django will load when presenting the user with a login screen?

  • auth/auth.html
  • registration/login.html
  • autos/login.html
  • home/login.html

Answer: registration/login.html


These are Django Features and Libraries Week 2 Answers Coursera Quiz


Q11. What variable do you check in a Django view to see if this request is from a logged-in user?

  • request.user.auth
  • is_authenticated.view
  • request.authenticated
  • request.user.is_authenticated

Answer: request.user.is_authenticated


Q12. What Django class does a class-based view need to extend to indicate that the view can only be accessed by logged-in users?

  • LoginRequiredMixin
  • AutoRedirectView
  • AutoLoginView
  • MustLoginView

Answer: LoginRequiredMixin


These are Django Features and Libraries Week 2 Answers Coursera Quiz


More Weeks of this course: Click Here

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


These are Django Features and Libraries Week 2 Answers Coursera Quiz