Skip to content

Glossary: Django Basics

get_object_or_404()

Also written: get_object_or_404

A shortcut that does a `.get()` but raises `Http404` instead of `DoesNotExist` when nothing matches, so a missing product gives a Not Found page.

Where the book teaches it

Related terms

Http404DoesNotExistQuerySet