move importlib to compat

This commit is contained in:
kazmiruk 2015-04-24 22:58:14 +07:00
parent 73e433ed5c
commit e3522e8aef
2 changed files with 9 additions and 5 deletions

View File

@ -284,3 +284,11 @@ if django.VERSION >= (1, 8):
from django.contrib.contenttypes.fields import GenericForeignKey
else:
from django.contrib.contenttypes.generic import GenericForeignKey
"""
django.utils.importlib is deprecated since django 1.8
"""
try:
import importlib
except ImportError:
from django.utils import importlib

View File

@ -21,11 +21,7 @@ from __future__ import unicode_literals
from django.conf import settings
from django.utils import six
from rest_framework import ISO_8601
try:
import importlib
except ImportError:
from django.utils import importlib
from rest_framework.compat import importlib
USER_SETTINGS = getattr(settings, 'REST_FRAMEWORK', None)