def get_object_or_404(klass, *args, **kwargs):
    queryset = _get_queryset(klass)
    try:
        return queryset.get(*args, **kwargs)
    except queryset.model.DoesNotExist:
        raise Http404('No %s matches the given query.' % queryset.model._meta.object_name)
Uses get() to return an object, or raises a Http404 exception if the object
dataset/ETHPy150Open dcramer/django-compositepks/django/shortcuts/__init__.py/get_object_or_404