  # Optional packages which may be used with REST framework.
  markdown==2.6.4
  django-guardian==1.4.6
  django-filter==0.14.0
  coreapi==2.0.8
 
</s> remove 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

 </s> add  </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     default_filter_set = FilterSet
    template = filter_template

    def __init__(self):
 </s> add     def __new__(cls, *args, **kwargs): </s> remove     coreapi, crispy_forms, distinct, django_filters, guardian, template_render
 </s> add     coreapi, distinct, django_filters, guardian, template_render
django-filter==0.15.3
  # Optional packages which may be used with REST framework.
  markdown==2.6.4
  django-guardian==1.4.6
django-filter==0.15.3
  coreapi==2.0.8
keep keep keep replace keep
 Deprecate DjangoFilter backend (#4593)

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