Skip to content

Commit d5516f9

Browse files
author
Carlton Gibson
authored
Try importing rest_framework module (#568)
* Try importing `rest_framework` module Fixes #567 * Correct Typo Thanks @kevin-brown!
1 parent f8a44d9 commit d5516f9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

django_filters/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
from .filterset import FilterSet
55
from .filters import *
66

7+
# We make the `rest_framework` module available without an additional import.
8+
# If DRF is not installed we simply set None.
9+
try:
10+
from . import rest_framework
11+
except ImportError:
12+
rest_framework = None
13+
714
__version__ = '1.0.0'
815

916

0 commit comments

Comments
 (0)