A

Admin • 833.24K Points
Coach

Q. How do you return a 404 error manually in a view?

  • (A) return 404
  • (B) raise PageNotFound
  • (C) raise Http404
  • (D) return HttpResponse(404)
  • Correct Answer - Option(C)
  • Views: 36
  • Filed under category Django
  • Hashtags:

Explanation by: Admin

`Http404` is raised to manually return a 404 error in Django views.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.