diff --git a/django_filters/__init__.py b/django_filters/__init__.py index 9d57b0fb2..815074a7e 100644 --- a/django_filters/__init__.py +++ b/django_filters/__init__.py @@ -1,15 +1,17 @@ # flake8: noqa from __future__ import absolute_import + +import pkgutil + from .constants import STRICTNESS from .filterset import FilterSet from .filters import * # We make the `rest_framework` module available without an additional import. -# If DRF is not installed we simply set None. -try: +# If DRF is not installed, no-op. +if pkgutil.find_loader('rest_framework') is not None: from . import rest_framework -except ImportError: - rest_framework = None +del pkgutil __version__ = '1.0.4'