mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 20:10:10 +03:00
Fix deprecation warning by using importlib when possible
This commit is contained in:
parent
d9d4c4353e
commit
7c14952a45
|
@ -20,7 +20,11 @@ back to the defaults.
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import importlib
|
try:
|
||||||
|
# Available in Python 2.7+
|
||||||
|
import importlib
|
||||||
|
except ImportError:
|
||||||
|
from django.utils import importlib
|
||||||
|
|
||||||
from rest_framework import ISO_8601
|
from rest_framework import ISO_8601
|
||||||
from rest_framework.compat import six
|
from rest_framework.compat import six
|
||||||
|
@ -51,7 +55,7 @@ DEFAULTS = {
|
||||||
'DEFAULT_CONTENT_NEGOTIATION_CLASS':
|
'DEFAULT_CONTENT_NEGOTIATION_CLASS':
|
||||||
'rest_framework.negotiation.DefaultContentNegotiation',
|
'rest_framework.negotiation.DefaultContentNegotiation',
|
||||||
|
|
||||||
# Genric view behavior
|
# Generic view behavior
|
||||||
'DEFAULT_MODEL_SERIALIZER_CLASS':
|
'DEFAULT_MODEL_SERIALIZER_CLASS':
|
||||||
'rest_framework.serializers.ModelSerializer',
|
'rest_framework.serializers.ModelSerializer',
|
||||||
'DEFAULT_PAGINATION_SERIALIZER_CLASS':
|
'DEFAULT_PAGINATION_SERIALIZER_CLASS':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user