Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions rest_framework/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ def value_from_object(field, obj):
JSONField = None


# coreapi is optional (Note that uritemplate is a dependency of coreapi)
try:
import coreapi
import uritemplate
except (ImportError, SyntaxError):
# SyntaxError is possible under python 3.2
coreapi = None
uritemplate = None


# django-filter is optional
try:
import django_filters
Expand All @@ -184,16 +194,6 @@ def value_from_object(field, obj):
crispy_forms = None


# coreapi is optional (Note that uritemplate is a dependency of coreapi)
try:
import coreapi
import uritemplate
except (ImportError, SyntaxError):
# SyntaxError is possible under python 3.2
coreapi = None
uritemplate = None


# requests is optional
try:
import requests
Expand Down