diff --git a/docs/index.md b/docs/index.md index 5101bd329..ccf7a7cd4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -78,7 +78,7 @@ Right now we're over 58% of the way towards achieving that.
-*Many thanks to all our [awesome sponsors][sponsors], and in particular to our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), and [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf).* +*Many thanks to all our [wonderful sponsors][sponsors], and in particular to our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), and [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf).* --- @@ -243,6 +243,7 @@ General guides to using REST framework. * [3.1 Announcement][3.1-announcement] * [3.2 Announcement][3.2-announcement] * [3.3 Announcement][3.3-announcement] +* [3.4 Announcement][3.4-announcement] * [Kickstarter Announcement][kickstarter-announcement] * [Mozilla Grant][mozilla-grant] * [Funding][funding] @@ -368,6 +369,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [3.1-announcement]: topics/3.1-announcement.md [3.2-announcement]: topics/3.2-announcement.md [3.3-announcement]: topics/3.3-announcement.md +[3.4-announcement]: topics/3.4-announcement.md [kickstarter-announcement]: topics/kickstarter-announcement.md [mozilla-grant]: topics/mozilla-grant.md [funding]: topics/funding.md diff --git a/docs/topics/3.4-announcement.md b/docs/topics/3.4-announcement.md new file mode 100644 index 000000000..51120ac86 --- /dev/null +++ b/docs/topics/3.4-announcement.md @@ -0,0 +1,129 @@ + + +# Django REST framework 3.4 + +The 3.4 release is the first in a planned series that will be addressing schema +generation, hypermedia support, API clients, and finally realtime support. + +--- + +## Funding + +The 3.4 release has been made possible a recent [Mozilla grant][moss], and by our +[collaborative funding model][funding]. If you use REST framework commercially, and would +like to see this work continue, we strongly encourage you to invest in its +continued development by **[signing up for a paid plan][funding]**. + +The initial aim is to provide a single full-time position on REST framework. +Right now we're over 60% of the way towards achieving that. +*Every single sign-up makes a significant impact.* + + + + +*Many thanks to all our [awesome sponsors][sponsors], and in particular to our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), and [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf).* + +--- + +## Schemas & client libraries + +REST framework 3.4 brings built-in support for generating API schemas. + +We're able to provide this support in a format-independent manner by using +[Core API][core-api], a Document Object Model for describing APIs. + +Taking this approach means that we're able to support numerous different +output formats for our API schemas, and should also open the door to a range +of auto-generated API documentation options in the future. + +Alongside the built-in schema support, we're also now providing the following: + +* A command line tool for interacting with APIs. +* A Python client library for interacting with APIs. + +These API clients are dynamically driven, and able to interact with any API +that exposes a supported schema format. + +You can read more about any of this new functionality in the following: + +* New tutorial section on [schemas & client libraries][tut-7]. +* Documentation page on [schema generation][schema-generation]. +* Topic page on [API clients][api-clients]. + +It is also worth noting that Marc Gibbons is currently working towards a 2.0 release of +the popular Django REST Swagger package, which will tie in with our new built-in support. + +--- + +## Supported versions + +The 3.4.0 release adds support for Django 1.10. + +The following versions of Python and Django are now supported: + +* Django versions 1.8, 1.9, and 1.10. +* Python versions 2.7, 3.2(\*), 3.3(\*), 3.4, 3.5. + +(\*) Note that Python 3.2 and 3.3 are not supported from Django 1.9 onwards. + +--- + +## Deprecations and behavioral changes + +The 3.4 release includes very limited deprecation or behavioral changes, and +should present a straightforward upgrade. + +#### Use fields or exclude on serializer classes. + +The following change in 3.3.0 is now escalated from "pending deprecation" to +"deprecated". Its usage will continue to function but will raise warnings: + +`ModelSerializer` and `HyperlinkedModelSerializer` should include either a `fields` +option, or an `exclude` option. The `fields = '__all__'` shortcut may be used +to explicitly include all fields. + +#### Microsecond precision when returning time or datetime + +Using the default JSON renderer and directly returning a `datetime` or `time` +instance will now render with microsecond precision (6 digits), rather than +millisecond precision (3 digits). This makes the output format consistent with the +default string output of `serializers.DateTimeField` and `serializers.TimeField`. + +This change *does not affect the default behavior when using serializers*, +which is to serialize `datetime` and `time` instances into strings with +microsecond precision. + +The serializer behavior can be modified if needed, using the `DATETIME_FORMAT` +and `TIME_FORMAT` settings. + +The renderer behavior can be modified by setting a custom `encoder_class` +attribute on a `JSONRenderer` subclass. + +[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors +[moss]: mozilla-grant.md +[funding]: funding.md +[core-api]: http://www.coreapi.org/ +[tut-7]: ../../tutorial/7-schemas-and-client-libraries/ +[schema-generation]: ../../api-guide/schemas/ +[api-clients]: api-clients.md diff --git a/docs/topics/api-clients.md b/docs/topics/api-clients.md index 635fd8ae0..25b0c6145 100644 --- a/docs/topics/api-clients.md +++ b/docs/topics/api-clients.md @@ -59,7 +59,7 @@ exposes a supported schema format. To install the Core API command line client, use `pip`. Note that the command-line client is a separate package to the -python client library `coreapi`. Make sure to install `coreapi-cli`. +python client library. Make sure to install `coreapi-cli`. $ pip install coreapi-cli diff --git a/mkdocs.yml b/mkdocs.yml index b10fbefb5..0b89988b1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,6 +65,7 @@ pages: - '3.1 Announcement': 'topics/3.1-announcement.md' - '3.2 Announcement': 'topics/3.2-announcement.md' - '3.3 Announcement': 'topics/3.3-announcement.md' + - '3.4 Announcement': 'topics/3.4-announcement.md' - 'Kickstarter Announcement': 'topics/kickstarter-announcement.md' - 'Mozilla Grant': 'topics/mozilla-grant.md' - 'Funding': 'topics/funding.md' diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index 6f02b8039..ab1a16597 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -8,7 +8,7 @@ ______ _____ _____ _____ __ """ __title__ = 'Django REST framework' -__version__ = '3.3.3' +__version__ = '3.4.0' __author__ = 'Tom Christie' __license__ = 'BSD 2-Clause' __copyright__ = 'Copyright 2011-2016 Tom Christie' diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 3fcc85c3b..8c39202f4 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -1013,12 +1013,12 @@ class ModelSerializer(Serializer): if fields is None and exclude is None: warnings.warn( "Creating a ModelSerializer without either the 'fields' " - "attribute or the 'exclude' attribute is pending deprecation " + "attribute or the 'exclude' attribute is deprecated " "since 3.3.0. Add an explicit fields = '__all__' to the " "{serializer_class} serializer.".format( serializer_class=self.__class__.__name__ ), - PendingDeprecationWarning + DeprecationWarning ) if fields == ALL_FIELDS: diff --git a/rest_framework/settings.py b/rest_framework/settings.py index 946b905c6..7ccdb3257 100644 --- a/rest_framework/settings.py +++ b/rest_framework/settings.py @@ -218,7 +218,7 @@ class APISettings(object): SETTINGS_DOC = "http://www.django-rest-framework.org/api-guide/settings/" for setting in REMOVED_SETTINGS: if setting in user_settings: - warnings.warn("The '%s' setting has been removed. Please refer to '%s' for available settings." % (setting, SETTINGS_DOC), DeprecationWarning) + raise RuntimeError("The '%s' setting has been removed. Please refer to '%s' for available settings." % (setting, SETTINGS_DOC)) return user_settings