      coreapi, crispy_forms, distinct, django_filters, guardian, template_render
  )
  from rest_framework.settings import api_settings
  
  if 'crispy_forms' in settings.INSTALLED_APPS and crispy_forms and django_filters:
      # If django-crispy-forms is installed, use it to get a bootstrap3 rendering
      # of the DjangoFilterBackend controls when displayed as HTML.
      from crispy_forms.helper import FormHelper
      from crispy_forms.layout import Layout, Submit
  
      class FilterSet(django_filters.FilterSet):
          def __init__(self, *args, **kwargs):
              super(FilterSet, self).__init__(*args, **kwargs)
              for field in self.form.fields.values():
                  field.help_text = None
  
              layout_components = list(self.form.fields.keys()) + [
                  Submit('', _('Submit'), css_class='btn-default'),
              ]
  
              helper = FormHelper()
              helper.form_method = 'GET'
              helper.template_pack = 'bootstrap3'
              helper.layout = Layout(*layout_components)
  
              self.form.helper = helper
  
      filter_template = 'rest_framework/filters/django_filter_crispyforms.html'
  
  elif django_filters:
      # If django-crispy-forms is not installed, use the standard
      # 'form.as_p' rendering when DjangoFilterBackend is displayed as HTML.
      class FilterSet(django_filters.FilterSet):
          def __init__(self, *args, **kwargs):
              super(FilterSet, self).__init__(*args, **kwargs)
              for field in self.form.fields.values():
                  field.help_text = None
  
      filter_template = 'rest_framework/filters/django_filter.html'
  
  else:
      FilterSet = None
      filter_template = None
  
  
  class BaseFilterBackend(object):
      """
      A base class from which all filter backend classes should inherit.
      """
 
</s> remove     coreapi, crispy_forms, distinct, django_filters, guardian, template_render
 </s> add     coreapi, distinct, django_filters, guardian, template_render </s> remove     default_filter_set = FilterSet
    template = filter_template

    def __init__(self):
 </s> add     def __new__(cls, *args, **kwargs): </s> remove         return None

    def filter_queryset(self, request, queryset, view):
        filter_class = self.get_filter_class(view, queryset)

        if filter_class:
            return filter_class(request.query_params, queryset=queryset).qs

        return queryset

    def to_html(self, request, queryset, view):
        filter_class = self.get_filter_class(view, queryset)
        if not filter_class:
            return None
        filter_instance = filter_class(request.query_params, queryset=queryset)
        context = {
            'filter': filter_instance
        }
        template = loader.get_template(self.template)
        return template_render(template, context)

    def get_schema_fields(self, view):
        assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
        filter_class = getattr(view, 'filter_class', None)
        if filter_class:
            return [
                coreapi.Field(name=field_name, required=False, location='query')
                for field_name in filter_class().filters.keys()
            ]

        filter_fields = getattr(view, 'filter_fields', None)
        if filter_fields:
            return [
                coreapi.Field(name=field_name, required=False, location='query')
                for field_name in filter_fields
            ]

        return []
 </s> add         return DjangoFilterBackend(*args, **kwargs) </s> remove             return AutoFilterSet
 </s> add         from django_filters.rest_framework import DjangoFilterBackend
      coreapi, crispy_forms, distinct, django_filters, guardian, template_render
  )
  from rest_framework.settings import api_settings
  








































  
  class BaseFilterBackend(object):
      """
      A base class from which all filter backend classes should inherit.
      """
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Deprecate DjangoFilter backend (#4593)

Deprecate the built-in `rest_framework.filters.DjangoFilterBackend` in favour of the third-party `django_filters.rest_framework.DjangoFilterBackend`. 
rest_framework/filters.py