summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.co.uk>2016-11-25 07:45:40 (GMT)
committerGitHub <noreply@github.com>2016-11-25 07:45:40 (GMT)
commitd5516f9828fd7ab5e59359ad6ade5fa5bcbbb949 (patch)
treed23d3e78435f24727a8148f812a2e0cee0c3b64d
parentf8a44d9e31e40fdf1e7b5867d21a0613acc618c2 (diff)
downloaddjango-filter-d5516f9828fd7ab5e59359ad6ade5fa5bcbbb949.zip
django-filter-d5516f9828fd7ab5e59359ad6ade5fa5bcbbb949.tar.gz
django-filter-d5516f9828fd7ab5e59359ad6ade5fa5bcbbb949.tar.bz2
Try importing `rest_framework` module (#568)
* Try importing `rest_framework` module Fixes #567 * Correct Typo Thanks @kevin-brown!
-rw-r--r--django_filters/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django_filters/__init__.py b/django_filters/__init__.py
index 6f24007..b9f9281 100644
--- a/django_filters/__init__.py
+++ b/django_filters/__init__.py
@@ -4,6 +4,13 @@ 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:
+ from . import rest_framework
+except ImportError:
+ rest_framework = None
+
__version__ = '1.0.0'