diff --git a/rest_framework/authentication.py b/rest_framework/authentication.py index 25150d525..414f4c8f7 100644 --- a/rest_framework/authentication.py +++ b/rest_framework/authentication.py @@ -1,7 +1,6 @@ """ Provides various authentication policies. """ -from __future__ import unicode_literals import base64 import binascii diff --git a/rest_framework/authtoken/migrations/0001_initial.py b/rest_framework/authtoken/migrations/0001_initial.py index 75780fedf..6a46ccfff 100644 --- a/rest_framework/authtoken/migrations/0001_initial.py +++ b/rest_framework/authtoken/migrations/0001_initial.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.conf import settings from django.db import migrations, models diff --git a/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py b/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py index 9f7e58e22..43119099a 100644 --- a/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py +++ b/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.conf import settings from django.db import migrations, models diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 1d34828bd..07b7301c7 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -3,8 +3,6 @@ The `compat` module provides support for backwards compatibility with older versions of Django/Python, and compatibility wrappers around optional packages. """ -from __future__ import unicode_literals - from django.conf import settings from django.core import validators from django.utils import six diff --git a/rest_framework/decorators.py b/rest_framework/decorators.py index f6d557d11..94ee2bf94 100644 --- a/rest_framework/decorators.py +++ b/rest_framework/decorators.py @@ -6,7 +6,6 @@ There are also various decorators for setting the API policies on function based views, as well as the `@detail_route` and `@list_route` decorators, which are used to annotate methods on viewsets that should be included by routers. """ -from __future__ import unicode_literals import types import warnings diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index f79b16129..0a26bb95c 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -4,7 +4,6 @@ Handled exceptions raised by REST framework. In addition Django's built in 403 and 404 exceptions are handled. (`django.http.Http404` and `django.core.exceptions.PermissionDenied`) """ -from __future__ import unicode_literals import math diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 70c210c16..68736e5af 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import collections import copy import datetime diff --git a/rest_framework/filters.py b/rest_framework/filters.py index 0627bd8c4..c93182282 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -2,7 +2,6 @@ Provides generic filtering backends that can be used to filter the results returned by list views. """ -from __future__ import unicode_literals import operator import warnings diff --git a/rest_framework/generics.py b/rest_framework/generics.py index 8d0bf284a..2034827c1 100644 --- a/rest_framework/generics.py +++ b/rest_framework/generics.py @@ -1,7 +1,6 @@ """ Generic views that provide commonly needed behaviour. """ -from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.db.models.query import QuerySet diff --git a/rest_framework/metadata.py b/rest_framework/metadata.py index 9f9324469..04bef3c92 100644 --- a/rest_framework/metadata.py +++ b/rest_framework/metadata.py @@ -6,7 +6,6 @@ some fairly ad-hoc information about the view. Future implementations might use JSON schema or other definitions in order to return this information in a more standardized way. """ -from __future__ import unicode_literals from collections import OrderedDict diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index de10d6930..8b868acb7 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -4,7 +4,6 @@ Basic building blocks for generic class based views. We don't bind behaviour to http method handlers yet, which allows mixin classes to be composed in interesting ways. """ -from __future__ import unicode_literals from rest_framework import status from rest_framework.response import Response diff --git a/rest_framework/negotiation.py b/rest_framework/negotiation.py index ca1b59f12..4897f63a7 100644 --- a/rest_framework/negotiation.py +++ b/rest_framework/negotiation.py @@ -2,7 +2,6 @@ Content negotiation deals with selecting an appropriate renderer given the incoming request. Typically this will be based on the request's Accept header. """ -from __future__ import unicode_literals from django.http import Http404 diff --git a/rest_framework/pagination.py b/rest_framework/pagination.py index b11d7cdf3..857063ec8 100644 --- a/rest_framework/pagination.py +++ b/rest_framework/pagination.py @@ -3,7 +3,6 @@ Pagination serializers determine the structure of the output that should be used for paginated responses. """ -from __future__ import unicode_literals from base64 import b64decode, b64encode from collections import OrderedDict, namedtuple diff --git a/rest_framework/parsers.py b/rest_framework/parsers.py index 35d0d1aa7..28902c725 100644 --- a/rest_framework/parsers.py +++ b/rest_framework/parsers.py @@ -4,7 +4,6 @@ Parsers are used to parse the content of incoming HTTP requests. They give us a generic way of being able to handle various media types on the request, such as form content or json encoded data. """ -from __future__ import unicode_literals import codecs diff --git a/rest_framework/permissions.py b/rest_framework/permissions.py index dfe89ed2a..f3f6e61db 100644 --- a/rest_framework/permissions.py +++ b/rest_framework/permissions.py @@ -1,7 +1,6 @@ """ Provides a set of pluggable permission policies. """ -from __future__ import unicode_literals from django.http import Http404 from django.utils import six diff --git a/rest_framework/relations.py b/rest_framework/relations.py index e8a4ec2ac..5b0250745 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -1,6 +1,3 @@ -# coding: utf-8 -from __future__ import unicode_literals - import sys from collections import OrderedDict diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index 375c38a85..155d18c93 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -6,7 +6,6 @@ on the response, such as JSON encoded data or HTML output. REST framework also provides an HTML renderer that renders the browsable API. """ -from __future__ import unicode_literals import base64 from collections import OrderedDict diff --git a/rest_framework/request.py b/rest_framework/request.py index a6d92e2bd..d87922930 100644 --- a/rest_framework/request.py +++ b/rest_framework/request.py @@ -8,7 +8,6 @@ The wrapped request then offers a richer API, in particular : - full support of PUT method, including support for file uploads - form overloading of HTTP method, content type and content """ -from __future__ import unicode_literals import io import sys diff --git a/rest_framework/response.py b/rest_framework/response.py index bf0663255..a8677199b 100644 --- a/rest_framework/response.py +++ b/rest_framework/response.py @@ -4,7 +4,6 @@ it is initialized with unrendered data, instead of a pre-rendered string. The appropriate renderer is called during Django's template response rendering. """ -from __future__ import unicode_literals from django.template.response import SimpleTemplateResponse from django.utils import six diff --git a/rest_framework/reverse.py b/rest_framework/reverse.py index e9cf737f1..1e0d8b43d 100644 --- a/rest_framework/reverse.py +++ b/rest_framework/reverse.py @@ -1,7 +1,6 @@ """ Provide urlresolver functions that return fully qualified URLs or view names """ -from __future__ import unicode_literals from django.urls import NoReverseMatch from django.urls import reverse as django_reverse diff --git a/rest_framework/routers.py b/rest_framework/routers.py index de04cb674..40377015a 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -13,7 +13,6 @@ For example, you might have a `urls.py` that looks something like this: urlpatterns = router.urls """ -from __future__ import unicode_literals import itertools import warnings diff --git a/rest_framework/schemas/inspectors.py b/rest_framework/schemas/inspectors.py index 02a38f351..9239361e8 100644 --- a/rest_framework/schemas/inspectors.py +++ b/rest_framework/schemas/inspectors.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ inspectors.py # Per-endpoint view introspection diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 110ffbfa9..a4595e70b 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -10,7 +10,6 @@ python primitives. 2. The process of marshalling between python primitives and request and response content is handled by parsers and renderers. """ -from __future__ import unicode_literals import copy import inspect diff --git a/rest_framework/settings.py b/rest_framework/settings.py index 8db9c81ed..f04a6b57f 100644 --- a/rest_framework/settings.py +++ b/rest_framework/settings.py @@ -18,7 +18,6 @@ This module provides the `api_setting` object, that is used to access REST framework settings, checking for user settings first, then falling back to the defaults. """ -from __future__ import unicode_literals from importlib import import_module diff --git a/rest_framework/status.py b/rest_framework/status.py index 4b4561cfc..1489b440c 100644 --- a/rest_framework/status.py +++ b/rest_framework/status.py @@ -5,7 +5,6 @@ See RFC 2616 - https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html And RFC 6585 - https://tools.ietf.org/html/rfc6585 And RFC 4918 - https://tools.ietf.org/html/rfc4918 """ -from __future__ import unicode_literals def is_informational(code): diff --git a/rest_framework/templatetags/rest_framework.py b/rest_framework/templatetags/rest_framework.py index 392338973..0a63eaed3 100644 --- a/rest_framework/templatetags/rest_framework.py +++ b/rest_framework/templatetags/rest_framework.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, unicode_literals - import re from collections import OrderedDict diff --git a/rest_framework/test.py b/rest_framework/test.py index edacf0066..b319a4fc5 100644 --- a/rest_framework/test.py +++ b/rest_framework/test.py @@ -1,8 +1,6 @@ -# -- coding: utf-8 -- - # Note that we import as `DjangoRequestFactory` and `DjangoClient` in order # to make it harder for the user to import the wrong thing without realizing. -from __future__ import unicode_literals + import io from importlib import import_module diff --git a/rest_framework/throttling.py b/rest_framework/throttling.py index 834ced148..3bb14eacc 100644 --- a/rest_framework/throttling.py +++ b/rest_framework/throttling.py @@ -1,7 +1,6 @@ """ Provides various throttling policies. """ -from __future__ import unicode_literals import time diff --git a/rest_framework/urlpatterns.py b/rest_framework/urlpatterns.py index ab3a74978..831d344dd 100644 --- a/rest_framework/urlpatterns.py +++ b/rest_framework/urlpatterns.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.conf.urls import include, url from rest_framework.compat import ( diff --git a/rest_framework/urls.py b/rest_framework/urls.py index 0e4c2661b..521a3db75 100644 --- a/rest_framework/urls.py +++ b/rest_framework/urls.py @@ -11,7 +11,6 @@ your API requires authentication: You should make sure your authentication settings include `SessionAuthentication`. """ -from __future__ import unicode_literals from django.conf.urls import url from django.contrib.auth import views diff --git a/rest_framework/utils/breadcrumbs.py b/rest_framework/utils/breadcrumbs.py index e0374ffd0..54990e9f6 100644 --- a/rest_framework/utils/breadcrumbs.py +++ b/rest_framework/utils/breadcrumbs.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - from django.urls import get_script_prefix, resolve diff --git a/rest_framework/utils/encoders.py b/rest_framework/utils/encoders.py index d8f4aeb4e..faf9a08c8 100644 --- a/rest_framework/utils/encoders.py +++ b/rest_framework/utils/encoders.py @@ -1,8 +1,6 @@ """ Helper classes for parsers. """ -from __future__ import absolute_import, unicode_literals - import datetime import decimal import json # noqa diff --git a/rest_framework/utils/formatting.py b/rest_framework/utils/formatting.py index aa805f14e..0c58665a8 100644 --- a/rest_framework/utils/formatting.py +++ b/rest_framework/utils/formatting.py @@ -1,7 +1,6 @@ """ Utility functions to return a formatted name and description for a given view. """ -from __future__ import unicode_literals import re diff --git a/rest_framework/utils/json.py b/rest_framework/utils/json.py index cb5572380..82b306dda 100644 --- a/rest_framework/utils/json.py +++ b/rest_framework/utils/json.py @@ -6,8 +6,6 @@ spec-compliant encoding/decoding. Support for non-standard features should be handled by users at the renderer and parser layer. """ -from __future__ import absolute_import - import functools import json # noqa diff --git a/rest_framework/utils/mediatypes.py b/rest_framework/utils/mediatypes.py index f4acf4807..1754fba53 100644 --- a/rest_framework/utils/mediatypes.py +++ b/rest_framework/utils/mediatypes.py @@ -3,7 +3,6 @@ Handling of media types, as found in HTTP Content-Type and Accept headers. See https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 """ -from __future__ import unicode_literals from django.http.multipartparser import parse_header from django.utils.encoding import python_2_unicode_compatible diff --git a/rest_framework/utils/representation.py b/rest_framework/utils/representation.py index deeaf1f63..6290065e3 100644 --- a/rest_framework/utils/representation.py +++ b/rest_framework/utils/representation.py @@ -2,7 +2,6 @@ Helper functions for creating user-friendly representations of serializer classes and serializer fields. """ -from __future__ import unicode_literals import re diff --git a/rest_framework/utils/serializer_helpers.py b/rest_framework/utils/serializer_helpers.py index 6b662a66c..068a37692 100644 --- a/rest_framework/utils/serializer_helpers.py +++ b/rest_framework/utils/serializer_helpers.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import collections from collections import OrderedDict diff --git a/rest_framework/validators.py b/rest_framework/validators.py index 2ea3e5ac1..df8ac8bcd 100644 --- a/rest_framework/validators.py +++ b/rest_framework/validators.py @@ -6,7 +6,6 @@ This gives us better separation of concerns, allows us to use single-step object creation, and makes it possible to switch between using the implicit `ModelSerializer` class and an equivalent explicit `Serializer` class. """ -from __future__ import unicode_literals from django.db import DataError from django.utils.translation import ugettext_lazy as _ diff --git a/rest_framework/versioning.py b/rest_framework/versioning.py index 5c9a7ade1..a98fdcd5f 100644 --- a/rest_framework/versioning.py +++ b/rest_framework/versioning.py @@ -1,6 +1,3 @@ -# coding: utf-8 -from __future__ import unicode_literals - import re from django.utils.translation import ugettext_lazy as _ diff --git a/rest_framework/views.py b/rest_framework/views.py index 04951ed93..ccc602982 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -1,7 +1,6 @@ """ Provides an APIView class that is the base of all views in REST framework. """ -from __future__ import unicode_literals from django.conf import settings from django.core.exceptions import PermissionDenied diff --git a/rest_framework/viewsets.py b/rest_framework/viewsets.py index 7146828d2..fa99e6e3d 100644 --- a/rest_framework/viewsets.py +++ b/rest_framework/viewsets.py @@ -16,7 +16,6 @@ automatically. router.register(r'users', UserViewSet, 'user') urlpatterns = router.urls """ -from __future__ import unicode_literals from collections import OrderedDict from functools import update_wrapper