mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-13 05:06:53 +03:00
move importlib to compat
This commit is contained in:
parent
73e433ed5c
commit
e3522e8aef
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user