Fix deprecation warning by using importlib when possible

This commit is contained in:
David Fischer 2014-03-26 14:00:28 +01:00
parent d9d4c4353e
commit 7c14952a45

View File

@ -20,6 +20,10 @@ back to the defaults.
from __future__ import unicode_literals
from django.conf import settings
try:
# Available in Python 2.7+
import importlib
except ImportError:
from django.utils import importlib
from rest_framework import ISO_8601
@ -51,7 +55,7 @@ DEFAULTS = {
'DEFAULT_CONTENT_NEGOTIATION_CLASS':
'rest_framework.negotiation.DefaultContentNegotiation',
# Genric view behavior
# Generic view behavior
'DEFAULT_MODEL_SERIALIZER_CLASS':
'rest_framework.serializers.ModelSerializer',
'DEFAULT_PAGINATION_SERIALIZER_CLASS':