diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 7ec39ba634..2d6e7843ca 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -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 @@ -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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy