A

Admin • 802.91K Points
Coach

Q. What is the purpose of get_object_or_404 in Django?

  • (A) Returns None if object is not found
  • (B) Redirects to login page
  • (C) Returns a 404 page if object is not found
  • (D) Returns an empty queryset
  • Correct Answer - Option(C)
  • Views: 5
  • Filed under category Django
  • Hashtags:

Explanation by: Admin
get_object_or_404 retrieves an object or returns a 404 error if not found.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.