  
  
  class GenericAPIView(views.APIView):
      """
      Base class for all other generic views.
      """
  
      # You'll need to either set these attributes,
 
</s> remove from django.shortcuts import get_object_or_404
 </s> add from django.shortcuts import get_object_or_404 as _get_object_or_404
def get_object_or_404(queryset, **filter_kwargs):
    """
    Same as Django's standard shortcut, but make sure to raise 404
    if the filter_kwargs don't match the required types.
    """
    try:
        return _get_object_or_404(queryset, **filter_kwargs)
    except (TypeError, ValueError):
        raise Http404


  
  
def get_object_or_404(queryset, **filter_kwargs):
    """
    Same as Django's standard shortcut, but make sure to raise 404
    if the filter_kwargs don't match the required types.
    """
    try:
        return _get_object_or_404(queryset, **filter_kwargs)
    except (TypeError, ValueError):
        raise Http404


  class GenericAPIView(views.APIView):
      """
      Base class for all other generic views.
      """
  
      # You'll need to either set these attributes,
keep add keep keep keep keep keep keep
 Raise 404 on incorrect lookup type in URL, not 500. Closes #890. 
rest_framework/generics.py