sounds like you want to use `get_object_or_404`