def get_object_or_404(queryset, *args, **kwargs):
    try:
        return queryset.get(*args, **kwargs)
    except (ValueError, TypeError, DoesNotExist):
        raise Http404()
replacement of rest_framework.generics and django.shrtcuts analogues
dataset/ETHPy150Open umutbozkurt/django-rest-framework-mongoengine/rest_framework_mongoengine/generics.py/get_object_or_404