πŸ“Š Django
Q. What does the get_object_or_404 function do?
  • (A) Returns object or shows 500 error
  • (B) Redirects on error
  • (C) Returns object or raises 404 error
  • (D) Logs missing object
πŸ’¬ Discuss
βœ… Correct Answer: (C) Returns object or raises 404 error

Explanation: get_object_or_404 returns an object or raises Http404 if not found.

Explanation by: Rakesh Yadav
get_object_or_404 returns an object or raises Http404 if not found.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
88
Total Visits
πŸ“½οΈ
11 mo ago
Published
πŸŽ–οΈ
Rakesh Yadav
Publisher
πŸ“ˆ
95%
Success Rate