Merge branch 'master' into localizedfloatfield

This commit is contained in:
kgeorgy 2017-04-10 11:48:29 +02:00 committed by GitHub
commit 5fa2b4e4a9
40 changed files with 685 additions and 655 deletions

View File

@ -35,7 +35,6 @@ matrix:
allow_failures: allow_failures:
- env: DJANGO=master - env: DJANGO=master
- env: DJANGO=1.11
install: install:
- pip install tox tox-travis - pip install tox tox-travis

View File

@ -50,7 +50,7 @@ Getting involved in triaging incoming issues is a good way to start contributing
To start developing on Django REST framework, clone the repo: To start developing on Django REST framework, clone the repo:
git clone git@github.com:tomchristie/django-rest-framework.git git clone git@github.com:encode/django-rest-framework.git
Changes should broadly follow the [PEP 8][pep-8] style conventions, and we recommend you set up your editor to automatically indicate non-conforming styles. Changes should broadly follow the [PEP 8][pep-8] style conventions, and we recommend you set up your editor to automatically indicate non-conforming styles.
@ -198,10 +198,10 @@ If you want to draw attention to a note or warning, use a pair of enclosing line
[code-of-conduct]: https://www.djangoproject.com/conduct/ [code-of-conduct]: https://www.djangoproject.com/conduct/
[google-group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework [google-group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework
[so-filter]: http://stackexchange.com/filters/66475/rest-framework [so-filter]: http://stackexchange.com/filters/66475/rest-framework
[issues]: https://github.com/tomchristie/django-rest-framework/issues?state=open [issues]: https://github.com/encode/django-rest-framework/issues?state=open
[pep-8]: http://www.python.org/dev/peps/pep-0008/ [pep-8]: http://www.python.org/dev/peps/pep-0008/
[pull-requests]: https://help.github.com/articles/using-pull-requests [pull-requests]: https://help.github.com/articles/using-pull-requests
[tox]: https://tox.readthedocs.io/en/latest/ [tox]: https://tox.readthedocs.io/en/latest/
[markdown]: http://daringfireball.net/projects/markdown/basics [markdown]: http://daringfireball.net/projects/markdown/basics
[docs]: https://github.com/tomchristie/django-rest-framework/tree/master/docs [docs]: https://github.com/encode/django-rest-framework/tree/master/docs
[mou]: http://mouapp.com/ [mou]: http://mouapp.com/

View File

@ -1,4 +1,4 @@
*Note*: Before submitting this pull request, please review our [contributing guidelines](https://github.com/tomchristie/django-rest-framework/blob/master/CONTRIBUTING.md#pull-requests). *Note*: Before submitting this pull request, please review our [contributing guidelines](https://github.com/encode/django-rest-framework/blob/master/CONTRIBUTING.md#pull-requests).
## Description ## Description

View File

@ -21,12 +21,12 @@ The initial aim is to provide a single full-time position on REST framework.
*Every single sign-up makes a significant impact towards making that possible.* *Every single sign-up makes a significant impact towards making that possible.*
<p align="center"> <p align="center">
<a href="http://jobs.rover.com/"><img src="https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/img/premium/rover-readme.png"/></a> <a href="http://jobs.rover.com/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/rover-readme.png"/></a>
<a href="https://getsentry.com/welcome/"><img src="https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/img/premium/sentry-readme.png"/></a> <a href="https://getsentry.com/welcome/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/sentry-readme.png"/></a>
<a href="https://getstream.io/try-the-api/?utm_source=drf&utm_medium=banner&utm_campaign=drf"><img src="https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/img/premium/stream-readme.png"/></a> <a href="https://getstream.io/try-the-api/?utm_source=drf&utm_medium=banner&utm_campaign=drf"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/stream-readme.png"/></a>
<a href="https://hello.machinalis.co.uk/"><img src="https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/img/premium/machinalis-readme.png"/></a> <a href="https://hello.machinalis.co.uk/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/machinalis-readme.png"/></a>
<a href="https://rollbar.com/"><img src="https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/img/premium/rollbar-readme.png"/></a> <a href="https://rollbar.com/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/rollbar-readme.png"/></a>
<a href="https://micropyramid.com/django-rest-framework-development-services/"><img src="https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/img/premium/micropyramid-readme.png"/></a> <a href="https://micropyramid.com/django-rest-framework-development-services/"><img src="https://raw.githubusercontent.com/encode/django-rest-framework/master/docs/img/premium/micropyramid-readme.png"/></a>
</p> </p>
*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/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), [Rollbar](https://rollbar.com), and [MicroPyramid](https://micropyramid.com/django-rest-framework-development-services/).* *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/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), [Rollbar](https://rollbar.com), and [MicroPyramid](https://micropyramid.com/django-rest-framework-development-services/).*
@ -176,10 +176,10 @@ If you believe you've found something in Django REST framework which has securit
Send a description of the issue via email to [rest-framework-security@googlegroups.com][security-mail]. The project maintainers will then work with you to resolve any issues where required, prior to any public disclosure. Send a description of the issue via email to [rest-framework-security@googlegroups.com][security-mail]. The project maintainers will then work with you to resolve any issues where required, prior to any public disclosure.
[build-status-image]: https://secure.travis-ci.org/tomchristie/django-rest-framework.svg?branch=master [build-status-image]: https://secure.travis-ci.org/encode/django-rest-framework.svg?branch=master
[travis]: http://travis-ci.org/tomchristie/django-rest-framework?branch=master [travis]: http://travis-ci.org/encode/django-rest-framework?branch=master
[coverage-status-image]: https://img.shields.io/codecov/c/github/tomchristie/django-rest-framework/master.svg [coverage-status-image]: https://img.shields.io/codecov/c/github/encode/django-rest-framework/master.svg
[codecov]: http://codecov.io/github/tomchristie/django-rest-framework?branch=master [codecov]: http://codecov.io/github/encode/django-rest-framework?branch=master
[pypi-version]: https://img.shields.io/pypi/v/djangorestframework.svg [pypi-version]: https://img.shields.io/pypi/v/djangorestframework.svg
[pypi]: https://pypi.python.org/pypi/djangorestframework [pypi]: https://pypi.python.org/pypi/djangorestframework
[twitter]: https://twitter.com/_tomchristie [twitter]: https://twitter.com/_tomchristie

View File

@ -18,10 +18,10 @@
</style> </style>
<p class="badges" height=20px> <p class="badges" height=20px>
<iframe src="http://ghbtns.com/github-btn.html?user=tomchristie&amp;repo=django-rest-framework&amp;type=watch&amp;count=true" class="github-star-button" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe> <iframe src="http://ghbtns.com/github-btn.html?user=encode&amp;repo=django-rest-framework&amp;type=watch&amp;count=true" class="github-star-button" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
<a href="http://travis-ci.org/tomchristie/django-rest-framework?branch=master"> <a href="http://travis-ci.org/encode/django-rest-framework?branch=master">
<img src="https://secure.travis-ci.org/tomchristie/django-rest-framework.svg?branch=master" class="status-badge"> <img src="https://secure.travis-ci.org/encode/django-rest-framework.svg?branch=master" class="status-badge">
</a> </a>
<a href="https://pypi.python.org/pypi/djangorestframework"> <a href="https://pypi.python.org/pypi/djangorestframework">
@ -108,7 +108,7 @@ Install using `pip`, including any optional packages you want...
...or clone the project from github. ...or clone the project from github.
git clone git@github.com:tomchristie/django-rest-framework.git git clone git@github.com:encode/django-rest-framework.git
Add `'rest_framework'` to your `INSTALLED_APPS` setting. Add `'rest_framework'` to your `INSTALLED_APPS` setting.
@ -311,7 +311,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[django-filter]: http://pypi.python.org/pypi/django-filter [django-filter]: http://pypi.python.org/pypi/django-filter
[django-crispy-forms]: https://github.com/maraujop/django-crispy-forms [django-crispy-forms]: https://github.com/maraujop/django-crispy-forms
[django-guardian]: https://github.com/lukaszb/django-guardian [django-guardian]: https://github.com/lukaszb/django-guardian
[0.4]: https://github.com/tomchristie/django-rest-framework/tree/0.4.X [0.4]: https://github.com/encode/django-rest-framework/tree/0.4.X
[image]: img/quickstart.png [image]: img/quickstart.png
[index]: . [index]: .
[oauth1-section]: api-guide/authentication/#django-rest-framework-oauth [oauth1-section]: api-guide/authentication/#django-rest-framework-oauth

View File

@ -155,5 +155,5 @@ From version 2.2 onwards, serializers with hyperlinked relationships *always* re
[mailing-list]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework [mailing-list]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework
[django-rest-framework-docs]: https://github.com/marcgibbons/django-rest-framework-docs [django-rest-framework-docs]: https://github.com/marcgibbons/django-rest-framework-docs
[marcgibbons]: https://github.com/marcgibbons/ [marcgibbons]: https://github.com/marcgibbons/
[issues]: https://github.com/tomchristie/django-rest-framework/issues [issues]: https://github.com/encode/django-rest-framework/issues
[564]: https://github.com/tomchristie/django-rest-framework/issues/564 [564]: https://github.com/encode/django-rest-framework/issues/564

View File

@ -167,6 +167,6 @@ Once again, many thanks to all the generous [backers and sponsors][kickstarter-s
[view-name-and-description-settings]: ../api-guide/settings#view-names-and-descriptions [view-name-and-description-settings]: ../api-guide/settings#view-names-and-descriptions
[client-ip-identification]: ../api-guide/throttling#how-clients-are-identified [client-ip-identification]: ../api-guide/throttling#how-clients-are-identified
[2-3-announcement]: 2.3-announcement [2-3-announcement]: 2.3-announcement
[github-labels]: https://github.com/tomchristie/django-rest-framework/issues [github-labels]: https://github.com/encode/django-rest-framework/issues
[github-milestones]: https://github.com/tomchristie/django-rest-framework/milestones [github-milestones]: https://github.com/encode/django-rest-framework/milestones
[kickstarter-sponsors]: kickstarter-announcement#sponsors [kickstarter-sponsors]: kickstarter-announcement#sponsors

View File

@ -957,9 +957,9 @@ The 3.1 release is planned to address improvements in the following components:
The 3.2 release is planned to introduce an alternative admin-style interface to the browsable API. The 3.2 release is planned to introduce an alternative admin-style interface to the browsable API.
You can follow development on the GitHub site, where we use [milestones to indicate planning timescales](https://github.com/tomchristie/django-rest-framework/milestones). You can follow development on the GitHub site, where we use [milestones to indicate planning timescales](https://github.com/encode/django-rest-framework/milestones).
[kickstarter]: http://kickstarter.com/projects/tomchristie/django-rest-framework-3 [kickstarter]: http://kickstarter.com/projects/tomchristie/django-rest-framework-3
[sponsors]: http://www.django-rest-framework.org/topics/kickstarter-announcement/#sponsors [sponsors]: http://www.django-rest-framework.org/topics/kickstarter-announcement/#sponsors
[mixins.py]: https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/mixins.py [mixins.py]: https://github.com/encode/django-rest-framework/blob/master/rest_framework/mixins.py
[django-localization]: https://docs.djangoproject.com/en/stable/topics/i18n/translation/#localization-how-to-create-language-files [django-localization]: https://docs.djangoproject.com/en/stable/topics/i18n/translation/#localization-how-to-create-language-files

View File

@ -8,7 +8,7 @@ This interface is intended to act as a more user-friendly interface to the API.
We've also fixed a huge number of issues, and made numerous cleanups and improvements. We've also fixed a huge number of issues, and made numerous cleanups and improvements.
Over the course of the 3.1.x series we've [resolved nearly 600 tickets](https://github.com/tomchristie/django-rest-framework/issues?utf8=%E2%9C%93&q=closed%3A%3E2015-03-05) on our GitHub issue tracker. This means we're currently running at a rate of **closing around 100 issues or pull requests per month**. Over the course of the 3.1.x series we've [resolved nearly 600 tickets](https://github.com/encode/django-rest-framework/issues?utf8=%E2%9C%93&q=closed%3A%3E2015-03-05) on our GitHub issue tracker. This means we're currently running at a rate of **closing around 100 issues or pull requests per month**.
None of this would have been possible without the support of our wonderful Kickstarter backers. If you're looking for a job in Django development we'd strongly recommend taking [a look through our sponsors](http://www.django-rest-framework.org/topics/kickstarter-announcement/#sponsors) and finding out who's hiring. None of this would have been possible without the support of our wonderful Kickstarter backers. If you're looking for a job in Django development we'd strongly recommend taking [a look through our sponsors](http://www.django-rest-framework.org/topics/kickstarter-announcement/#sponsors) and finding out who's hiring.

View File

@ -53,6 +53,6 @@ The following pagination view attributes and settings have been moved into attri
The `ModelSerializer` and `HyperlinkedModelSerializer` classes should now include either a `fields` or `exclude` option, although the `fields = '__all__'` shortcut may be used. Failing to include either of these two options is currently pending deprecation, and will be removed entirely in the 3.5 release. This behavior brings `ModelSerializer` more closely in line with Django's `ModelForm` behavior. The `ModelSerializer` and `HyperlinkedModelSerializer` classes should now include either a `fields` or `exclude` option, although the `fields = '__all__'` shortcut may be used. Failing to include either of these two options is currently pending deprecation, and will be removed entirely in the 3.5 release. This behavior brings `ModelSerializer` more closely in line with Django's `ModelForm` behavior.
[forms-api]: html-and-forms.md [forms-api]: html-and-forms.md
[ajax-form]: https://github.com/tomchristie/ajax-form [ajax-form]: https://github.com/encode/ajax-form
[jsonfield]: ../../api-guide/fields#jsonfield [jsonfield]: ../../api-guide/fields#jsonfield
[django-supported-versions]: https://www.djangoproject.com/download/#supported-versions [django-supported-versions]: https://www.djangoproject.com/download/#supported-versions

View File

@ -188,7 +188,7 @@ The full set of itemized release notes [are available here][release-notes].
[tut-7]: ../../tutorial/7-schemas-and-client-libraries/ [tut-7]: ../../tutorial/7-schemas-and-client-libraries/
[schema-generation]: ../../api-guide/schemas/ [schema-generation]: ../../api-guide/schemas/
[api-clients]: api-clients.md [api-clients]: api-clients.md
[milestone]: https://github.com/tomchristie/django-rest-framework/milestone/35 [milestone]: https://github.com/encode/django-rest-framework/milestone/35
[release-notes]: release-notes#34 [release-notes]: release-notes#34
[metadata]: ../../api-guide/metadata/#custom-metadata-classes [metadata]: ../../api-guide/metadata/#custom-metadata-classes
[gh3751]: https://github.com/tomchristie/django-rest-framework/issues/3751 [gh3751]: https://github.com/encode/django-rest-framework/issues/3751

View File

@ -261,6 +261,6 @@ in version 3.3 and raised a deprecation warning in 3.4. Its usage is now mandato
[schema-generation-api]: ../api-guide/schemas/#schemagenerator [schema-generation-api]: ../api-guide/schemas/#schemagenerator
[schema-docs]: ../api-guide/schemas/#schemas-as-documentation [schema-docs]: ../api-guide/schemas/#schemas-as-documentation
[schema-view]: ../api-guide/schemas/#the-get_schema_view-shortcut [schema-view]: ../api-guide/schemas/#the-get_schema_view-shortcut
[django-rest-raml]: https://github.com/tomchristie/django-rest-raml [django-rest-raml]: https://github.com/encode/django-rest-raml
[raml-image]: ../img/raml.png [raml-image]: ../img/raml.png
[raml-codec]: https://github.com/core-api/python-raml-codec [raml-codec]: https://github.com/core-api/python-raml-codec

View File

@ -81,7 +81,7 @@ was later [dropped from the spec][html5]. There remains
as well as how to support content types other than form-encoded data. as well as how to support content types other than form-encoded data.
[cite]: http://www.amazon.com/Restful-Web-Services-Leonard-Richardson/dp/0596529260 [cite]: http://www.amazon.com/Restful-Web-Services-Leonard-Richardson/dp/0596529260
[ajax-form]: https://github.com/tomchristie/ajax-form [ajax-form]: https://github.com/encode/ajax-form
[rails]: http://guides.rubyonrails.org/form_helpers.html#how-do-forms-with-put-or-delete-methods-work [rails]: http://guides.rubyonrails.org/form_helpers.html#how-do-forms-with-put-or-delete-methods-work
[html5]: http://www.w3.org/TR/html5-diff/#changes-2010-06-24 [html5]: http://www.w3.org/TR/html5-diff/#changes-2010-06-24
[put_delete]: http://amundsen.com/examples/put-delete-forms/ [put_delete]: http://amundsen.com/examples/put-delete-forms/

View File

@ -50,7 +50,7 @@ Getting involved in triaging incoming issues is a good way to start contributing
To start developing on Django REST framework, clone the repo: To start developing on Django REST framework, clone the repo:
git clone git@github.com:tomchristie/django-rest-framework.git git clone git@github.com:encode/django-rest-framework.git
Changes should broadly follow the [PEP 8][pep-8] style conventions, and we recommend you set up your editor to automatically indicate non-conforming styles. Changes should broadly follow the [PEP 8][pep-8] style conventions, and we recommend you set up your editor to automatically indicate non-conforming styles.
@ -202,11 +202,11 @@ If you want to draw attention to a note or warning, use a pair of enclosing line
[code-of-conduct]: https://www.djangoproject.com/conduct/ [code-of-conduct]: https://www.djangoproject.com/conduct/
[google-group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework [google-group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework
[so-filter]: http://stackexchange.com/filters/66475/rest-framework [so-filter]: http://stackexchange.com/filters/66475/rest-framework
[issues]: https://github.com/tomchristie/django-rest-framework/issues?state=open [issues]: https://github.com/encode/django-rest-framework/issues?state=open
[pep-8]: http://www.python.org/dev/peps/pep-0008/ [pep-8]: http://www.python.org/dev/peps/pep-0008/
[travis-status]: ../img/travis-status.png [travis-status]: ../img/travis-status.png
[pull-requests]: https://help.github.com/articles/using-pull-requests [pull-requests]: https://help.github.com/articles/using-pull-requests
[tox]: https://tox.readthedocs.io/en/latest/ [tox]: https://tox.readthedocs.io/en/latest/
[markdown]: http://daringfireball.net/projects/markdown/basics [markdown]: http://daringfireball.net/projects/markdown/basics
[docs]: https://github.com/tomchristie/django-rest-framework/tree/master/docs [docs]: https://github.com/encode/django-rest-framework/tree/master/docs
[mou]: http://mouapp.com/ [mou]: http://mouapp.com/

View File

@ -106,7 +106,7 @@ For API clients the most appropriate of these will typically be to use the `Acce
[django-translation]: https://docs.djangoproject.com/en/1.7/topics/i18n/translation [django-translation]: https://docs.djangoproject.com/en/1.7/topics/i18n/translation
[custom-exception-handler]: ../api-guide/exceptions.md#custom-exception-handling [custom-exception-handler]: ../api-guide/exceptions.md#custom-exception-handling
[transifex-project]: https://www.transifex.com/projects/p/django-rest-framework/ [transifex-project]: https://www.transifex.com/projects/p/django-rest-framework/
[django-po-source]: https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/rest_framework/locale/en_US/LC_MESSAGES/django.po [django-po-source]: https://raw.githubusercontent.com/encode/django-rest-framework/master/rest_framework/locale/en_US/LC_MESSAGES/django.po
[django-language-preference]: https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#how-django-discovers-language-preference [django-language-preference]: https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#how-django-discovers-language-preference
[django-locale-paths]: https://docs.djangoproject.com/en/1.7/ref/settings/#std:setting-LOCALE_PATHS [django-locale-paths]: https://docs.djangoproject.com/en/1.7/ref/settings/#std:setting-LOCALE_PATHS
[django-locale-name]: https://docs.djangoproject.com/en/1.7/topics/i18n/#term-locale-name [django-locale-name]: https://docs.djangoproject.com/en/1.7/topics/i18n/#term-locale-name

View File

@ -35,5 +35,5 @@ Wonder how else you can help? One of the best ways you can help Django REST Fram
[remoteok-io]: https://remoteok.io/remote-django-jobs [remoteok-io]: https://remoteok.io/remote-django-jobs
[remotepython-com]: https://www.remotepython.com/jobs/ [remotepython-com]: https://www.remotepython.com/jobs/
[drf-funding]: https://fund.django-rest-framework.org/topics/funding/ [drf-funding]: https://fund.django-rest-framework.org/topics/funding/
[submit-pr]: https://github.com/tomchristie/django-rest-framework [submit-pr]: https://github.com/encode/django-rest-framework
[anna-email]: mailto:anna@django-rest-framework.org [anna-email]: mailto:anna@django-rest-framework.org

View File

@ -17,9 +17,9 @@ We have a quarterly maintenance cycle where new members may join the maintenance
#### Current team #### Current team
The [maintenance team for Q4 2015](https://github.com/tomchristie/django-rest-framework/issues/2190): The [maintenance team for Q4 2015](https://github.com/encode/django-rest-framework/issues/2190):
* [@tomchristie](https://github.com/tomchristie/) * [@tomchristie](https://github.com/encode/)
* [@xordoquy](https://github.com/xordoquy/) (Release manager.) * [@xordoquy](https://github.com/xordoquy/) (Release manager.)
* [@carltongibson](https://github.com/carltongibson/) * [@carltongibson](https://github.com/carltongibson/)
* [@kevin-brown](https://github.com/kevin-brown/) * [@kevin-brown](https://github.com/kevin-brown/)
@ -104,9 +104,9 @@ The following template should be used for the description of the issue, and serv
Checklist: Checklist:
- [ ] Create pull request for [release notes](https://github.com/tomchristie/django-rest-framework/blob/master/docs/topics/release-notes.md) based on the [*.*.* milestone](https://github.com/tomchristie/django-rest-framework/milestones/***). - [ ] Create pull request for [release notes](https://github.com/encode/django-rest-framework/blob/master/docs/topics/release-notes.md) based on the [*.*.* milestone](https://github.com/encode/django-rest-framework/milestones/***).
- [ ] Update the translations from [transifex](http://www.django-rest-framework.org/topics/project-management/#translations). - [ ] Update the translations from [transifex](http://www.django-rest-framework.org/topics/project-management/#translations).
- [ ] Ensure the pull request increments the version to `*.*.*` in [`restframework/__init__.py`](https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/__init__.py). - [ ] Ensure the pull request increments the version to `*.*.*` in [`restframework/__init__.py`](https://github.com/encode/django-rest-framework/blob/master/rest_framework/__init__.py).
- [ ] Confirm with @tomchristie that release is finalized and ready to go. - [ ] Confirm with @tomchristie that release is finalized and ready to go.
- [ ] Ensure that release date is included in pull request. - [ ] Ensure that release date is included in pull request.
- [ ] Merge the release pull request. - [ ] Merge the release pull request.
@ -197,10 +197,10 @@ The following issues still need to be addressed:
* Document ownership and management of the security mailing list. * Document ownership and management of the security mailing list.
[bus-factor]: http://en.wikipedia.org/wiki/Bus_factor [bus-factor]: http://en.wikipedia.org/wiki/Bus_factor
[un-triaged]: https://github.com/tomchristie/django-rest-framework/issues?q=is%3Aopen+no%3Alabel [un-triaged]: https://github.com/encode/django-rest-framework/issues?q=is%3Aopen+no%3Alabel
[transifex-project]: https://www.transifex.com/projects/p/django-rest-framework/ [transifex-project]: https://www.transifex.com/projects/p/django-rest-framework/
[transifex-client]: https://pypi.python.org/pypi/transifex-client [transifex-client]: https://pypi.python.org/pypi/transifex-client
[translation-memory]: http://docs.transifex.com/guides/tm#let-tm-automatically-populate-translations [translation-memory]: http://docs.transifex.com/guides/tm#let-tm-automatically-populate-translations
[github-org]: https://github.com/tomchristie/django-rest-framework/issues/2162 [github-org]: https://github.com/encode/django-rest-framework/issues/2162
[sandbox]: http://restframework.herokuapp.com/ [sandbox]: http://restframework.herokuapp.com/
[mailing-list]: https://groups.google.com/forum/#!forum/django-rest-framework [mailing-list]: https://groups.google.com/forum/#!forum/django-rest-framework

File diff suppressed because it is too large Load Diff

View File

@ -272,10 +272,10 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque
[pypi-register]: https://pypi.python.org/pypi?%3Aaction=register_form [pypi-register]: https://pypi.python.org/pypi?%3Aaction=register_form
[semver]: http://semver.org/ [semver]: http://semver.org/
[tox-docs]: https://tox.readthedocs.io/en/latest/ [tox-docs]: https://tox.readthedocs.io/en/latest/
[drf-compat]: https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/compat.py [drf-compat]: https://github.com/encode/django-rest-framework/blob/master/rest_framework/compat.py
[rest-framework-grid]: https://www.djangopackages.com/grids/g/django-rest-framework/ [rest-framework-grid]: https://www.djangopackages.com/grids/g/django-rest-framework/
[drf-create-pr]: https://github.com/tomchristie/django-rest-framework/compare [drf-create-pr]: https://github.com/encode/django-rest-framework/compare
[drf-create-issue]: https://github.com/tomchristie/django-rest-framework/issues/new [drf-create-issue]: https://github.com/encode/django-rest-framework/issues/new
[authentication]: ../api-guide/authentication.md [authentication]: ../api-guide/authentication.md
[permissions]: ../api-guide/permissions.md [permissions]: ../api-guide/permissions.md
[third-party-packages]: ../topics/third-party-packages/#existing-third-party-packages [third-party-packages]: ../topics/third-party-packages/#existing-third-party-packages

View File

@ -106,5 +106,5 @@ Want your Django REST Framework talk/tutorial/article to be added to our website
[drf-an-intro]: https://realpython.com/blog/python/django-rest-framework-quick-start/ [drf-an-intro]: https://realpython.com/blog/python/django-rest-framework-quick-start/
[drf-tutorial]: https://tests4geeks.com/django-rest-framework-tutorial/ [drf-tutorial]: https://tests4geeks.com/django-rest-framework-tutorial/
[building-a-restful-api-with-drf]: http://agiliq.com/blog/2014/12/building-a-restful-api-with-django-rest-framework/ [building-a-restful-api-with-drf]: http://agiliq.com/blog/2014/12/building-a-restful-api-with-django-rest-framework/
[submit-pr]: https://github.com/tomchristie/django-rest-framework [submit-pr]: https://github.com/encode/django-rest-framework
[anna-email]: mailto:anna@django-rest-framework.org [anna-email]: mailto:anna@django-rest-framework.org

View File

@ -373,7 +373,7 @@ Our API views don't do anything particularly special at the moment, beyond servi
We'll see how we can start to improve things in [part 2 of the tutorial][tut-2]. We'll see how we can start to improve things in [part 2 of the tutorial][tut-2].
[quickstart]: quickstart.md [quickstart]: quickstart.md
[repo]: https://github.com/tomchristie/rest-framework-tutorial [repo]: https://github.com/encode/rest-framework-tutorial
[sandbox]: http://restframework.herokuapp.com/ [sandbox]: http://restframework.herokuapp.com/
[virtualenv]: http://www.virtualenv.org/en/latest/index.html [virtualenv]: http://www.virtualenv.org/en/latest/index.html
[tut-2]: 2-requests-and-responses.md [tut-2]: 2-requests-and-responses.md

View File

@ -221,8 +221,8 @@ We've reached the end of our tutorial. If you want to get more involved in the
[coreapi]: http://www.coreapi.org [coreapi]: http://www.coreapi.org
[corejson]: http://www.coreapi.org/specification/encoding/#core-json-encoding [corejson]: http://www.coreapi.org/specification/encoding/#core-json-encoding
[openapi]: https://openapis.org/ [openapi]: https://openapis.org/
[repo]: https://github.com/tomchristie/rest-framework-tutorial [repo]: https://github.com/encode/rest-framework-tutorial
[sandbox]: http://restframework.herokuapp.com/ [sandbox]: http://restframework.herokuapp.com/
[github]: https://github.com/tomchristie/django-rest-framework [github]: https://github.com/encode/django-rest-framework
[group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework [group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework
[twitter]: https://twitter.com/_tomchristie [twitter]: https://twitter.com/_tomchristie

View File

@ -114,7 +114,7 @@
{% block content %} {% block content %}
{% if page.meta.source %} {% if page.meta.source %}
{% for filename in page.meta.source %} {% for filename in page.meta.source %}
<a class="github" href="https://github.com/tomchristie/django-rest-framework/tree/master/rest_framework/{{ filename }}"> <a class="github" href="https://github.com/encode/django-rest-framework/tree/master/rest_framework/{{ filename }}">
<span class="label label-info">{{ filename }}</span> <span class="label label-info">{{ filename }}</span>
</a> </a>
{% endfor %} {% endfor %}

View File

@ -1,7 +1,7 @@
<div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container-fluid"> <div class="container-fluid">
<a class="repo-link btn btn-primary btn-small" href="https://github.com/tomchristie/django-rest-framework/tree/master">GitHub</a> <a class="repo-link btn btn-primary btn-small" href="https://github.com/encode/django-rest-framework/tree/master">GitHub</a>
<a class="repo-link btn btn-inverse btn-small {% if not page.next_page %}disabled{% endif %}" rel="prev" {% if page.next_page %}href="{{ page.next_page.url }}"{% endif %}> <a class="repo-link btn btn-inverse btn-small {% if not page.next_page %}disabled{% endif %}" rel="prev" {% if page.next_page %}href="{{ page.next_page.url }}"{% endif %}>
Next <i class="icon-arrow-right icon-white"></i> Next <i class="icon-arrow-right icon-white"></i>
</a> </a>

View File

@ -2,7 +2,7 @@ site_name: Django REST framework
site_url: http://www.django-rest-framework.org/ site_url: http://www.django-rest-framework.org/
site_description: Django REST framework - Web APIs for Django site_description: Django REST framework - Web APIs for Django
repo_url: https://github.com/tomchristie/django-rest-framework repo_url: https://github.com/encode/django-rest-framework
theme_dir: docs_theme theme_dir: docs_theme

View File

@ -24,7 +24,7 @@ class Token(models.Model):
# https://code.djangoproject.com/ticket/19422 # https://code.djangoproject.com/ticket/19422
# #
# Also see corresponding ticket: # Also see corresponding ticket:
# https://github.com/tomchristie/django-rest-framework/issues/705 # https://github.com/encode/django-rest-framework/issues/705
abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS
verbose_name = _("Token") verbose_name = _("Token")
verbose_name_plural = _("Tokens") verbose_name_plural = _("Tokens")

View File

@ -620,8 +620,8 @@ class Field(object):
originally created with, rather than copying the complete state. originally created with, rather than copying the complete state.
""" """
# Treat regexes and validators as immutable. # Treat regexes and validators as immutable.
# See https://github.com/tomchristie/django-rest-framework/issues/1954 # See https://github.com/encode/django-rest-framework/issues/1954
# and https://github.com/tomchristie/django-rest-framework/pull/4489 # and https://github.com/encode/django-rest-framework/pull/4489
args = [ args = [
copy.deepcopy(item) if not isinstance(item, REGEX_TYPE) else item copy.deepcopy(item) if not isinstance(item, REGEX_TYPE) else item
for item in self._args for item in self._args

View File

@ -323,7 +323,7 @@ class DjangoObjectPermissionsFilter(BaseFilterBackend):
def filter_queryset(self, request, queryset, view): def filter_queryset(self, request, queryset, view):
# We want to defer this import until run-time, rather than import-time. # We want to defer this import until run-time, rather than import-time.
# See https://github.com/tomchristie/django-rest-framework/issues/4608 # See https://github.com/encode/django-rest-framework/issues/4608
# (Also see #1624 for why we need to make this import explicitly) # (Also see #1624 for why we need to make this import explicitly)
from guardian.shortcuts import get_objects_for_user from guardian.shortcuts import get_objects_for_user

View File

@ -24,11 +24,12 @@ def get_breadcrumbs(url, request=None):
# Check if this is a REST framework view, # Check if this is a REST framework view,
# and if so add it to the breadcrumbs # and if so add it to the breadcrumbs
cls = getattr(view, 'cls', None) cls = getattr(view, 'cls', None)
initkwargs = getattr(view, 'initkwargs', {})
if cls is not None and issubclass(cls, APIView): if cls is not None and issubclass(cls, APIView):
# Don't list the same view twice in a row. # Don't list the same view twice in a row.
# Probably an optional trailing slash. # Probably an optional trailing slash.
if not seen or seen[-1] != view: if not seen or seen[-1] != view:
c = cls() c = cls(**initkwargs)
c.suffix = getattr(view, 'suffix', None) c.suffix = getattr(view, 'suffix', None)
name = c.get_view_name() name = c.get_view_name()
insert_url = preserve_builtin_query_params(prefix + url, request) insert_url = preserve_builtin_query_params(prefix + url, request)

View File

@ -18,7 +18,7 @@ from rest_framework.utils.representation import smart_repr
# Robust filter and exist implementations. Ensures that queryset.exists() for # Robust filter and exist implementations. Ensures that queryset.exists() for
# an invalid value returns `False`, rather than raising an error. # an invalid value returns `False`, rather than raising an error.
# Refs https://github.com/tomchristie/django-rest-framework/issues/3381 # Refs https://github.com/encode/django-rest-framework/issues/3381
def qs_exists(queryset): def qs_exists(queryset):
try: try:

View File

@ -9,6 +9,7 @@ from django.db import models
from django.http import Http404 from django.http import Http404
from django.http.response import HttpResponseBase from django.http.response import HttpResponseBase
from django.utils import six from django.utils import six
from django.utils.cache import cc_delim_re, patch_vary_headers
from django.utils.encoding import smart_text from django.utils.encoding import smart_text
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
@ -290,7 +291,7 @@ class APIView(View):
""" """
Returns the exception handler that this view uses. Returns the exception handler that this view uses.
""" """
return api_settings.EXCEPTION_HANDLER return self.settings.EXCEPTION_HANDLER
# API policy implementation methods # API policy implementation methods
@ -414,6 +415,11 @@ class APIView(View):
response.accepted_media_type = request.accepted_media_type response.accepted_media_type = request.accepted_media_type
response.renderer_context = self.get_renderer_context() response.renderer_context = self.get_renderer_context()
# Add new vary headers to the response instead of overwriting.
vary_headers = self.headers.pop('Vary', None)
if vary_headers is not None:
patch_vary_headers(response, cc_delim_re.split(vary_headers))
for key, value in self.headers.items(): for key, value in self.headers.items():
response[key] = value response[key] = value

View File

@ -44,7 +44,7 @@ class TestManyPostView(TestCase):
POST request to a view that returns a list of objects should POST request to a view that returns a list of objects should
still successfully return the browsable API with a rendered form. still successfully return the browsable API with a rendered form.
Regression test for https://github.com/tomchristie/django-rest-framework/pull/3164 Regression test for https://github.com/encode/django-rest-framework/pull/3164
""" """
data = {} data = {}
request = factory.post('/', data, format='json') request = factory.post('/', data, format='json')

View File

@ -127,7 +127,7 @@ class BasicAuthTests(TestCase):
def test_regression_handle_bad_base64_basic_auth_header(self): def test_regression_handle_bad_base64_basic_auth_header(self):
"""Ensure POSTing JSON over basic auth with incorrectly padded Base64 string is handled correctly""" """Ensure POSTing JSON over basic auth with incorrectly padded Base64 string is handled correctly"""
# regression test for issue in 'rest_framework.authentication.BasicAuthentication.authenticate' # regression test for issue in 'rest_framework.authentication.BasicAuthentication.authenticate'
# https://github.com/tomchristie/django-rest-framework/issues/4089 # https://github.com/encode/django-rest-framework/issues/4089
auth = 'Basic =a=' auth = 'Basic =a='
response = self.csrf_client.post( response = self.csrf_client.post(
'/basic/', '/basic/',
@ -185,7 +185,7 @@ class SessionAuthTests(TestCase):
""" """
Ensure the login template renders for a basic GET. Ensure the login template renders for a basic GET.
cf. [#1810](https://github.com/tomchristie/django-rest-framework/pull/1810) cf. [#1810](https://github.com/encode/django-rest-framework/pull/1810)
""" """
response = self.csrf_client.get('/auth/login/') response = self.csrf_client.get('/auth/login/')
content = response.content.decode('utf8') content = response.content.decode('utf8')

View File

@ -96,7 +96,7 @@ class TestViewNamesAndDescriptions(TestCase):
Ensure a view may have a docstring that is actually a lazily evaluated Ensure a view may have a docstring that is actually a lazily evaluated
class that can be converted to a string. class that can be converted to a string.
See: https://github.com/tomchristie/django-rest-framework/issues/1708 See: https://github.com/encode/django-rest-framework/issues/1708
""" """
# use a mock object instead of gettext_lazy to ensure that we can't end # use a mock object instead of gettext_lazy to ensure that we can't end
# up with a test case string in our l10n catalog # up with a test case string in our l10n catalog

View File

@ -398,7 +398,7 @@ class TestCreateModelWithAutoNowAddField(TestCase):
""" """
Regression test for #285 Regression test for #285
https://github.com/tomchristie/django-rest-framework/issues/285 https://github.com/encode/django-rest-framework/issues/285
""" """
data = {'email': 'foobar@example.com', 'content': 'foobar'} data = {'email': 'foobar@example.com', 'content': 'foobar'}
request = factory.post('/', data, format='json') request = factory.post('/', data, format='json')

View File

@ -43,7 +43,7 @@ class TestPrefetchRelatedUpdates(TestCase):
def test_prefetch_related_excluding_instance_from_original_queryset(self): def test_prefetch_related_excluding_instance_from_original_queryset(self):
""" """
Regression test for https://github.com/tomchristie/django-rest-framework/issues/4661 Regression test for https://github.com/encode/django-rest-framework/issues/4661
""" """
view = UserUpdate.as_view() view = UserUpdate.as_view()
pk = self.user.pk pk = self.user.pk

View File

@ -335,7 +335,7 @@ class PKForeignKeyTests(TestCase):
""" """
Regression test for #1072 Regression test for #1072
https://github.com/tomchristie/django-rest-framework/issues/1072 https://github.com/encode/django-rest-framework/issues/1072
""" """
serializer = NullableForeignKeySourceSerializer() serializer = NullableForeignKeySourceSerializer()
assert serializer.data['target'] is None assert serializer.data['target'] is None

View File

@ -242,7 +242,7 @@ class RendererEndToEndTests(TestCase):
""" """
Regression test for #1196 Regression test for #1196
https://github.com/tomchristie/django-rest-framework/issues/1196 https://github.com/encode/django-rest-framework/issues/1196
""" """
resp = self.client.get('/empty') resp = self.client.get('/empty')
self.assertEqual(resp.get('Content-Type', None), None) self.assertEqual(resp.get('Content-Type', None), None)

View File

@ -8,7 +8,7 @@ from django.test import TestCase
from rest_framework import status from rest_framework import status
from rest_framework.decorators import api_view from rest_framework.decorators import api_view
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.settings import api_settings from rest_framework.settings import APISettings, api_settings
from rest_framework.test import APIRequestFactory from rest_framework.test import APIRequestFactory
from rest_framework.views import APIView from rest_framework.views import APIView
@ -45,6 +45,19 @@ class ErrorView(APIView):
raise Exception raise Exception
def custom_handler(exc, context):
if isinstance(exc, SyntaxError):
return Response({'error': 'SyntaxError'}, status=400)
return Response({'error': 'UnknownError'}, status=500)
class OverridenSettingsView(APIView):
settings = APISettings({'EXCEPTION_HANDLER': custom_handler})
def get(self, request, *args, **kwargs):
raise SyntaxError('request is invalid syntax')
@api_view(['GET']) @api_view(['GET'])
def error_view(request): def error_view(request):
raise Exception raise Exception
@ -118,3 +131,14 @@ class TestCustomExceptionHandler(TestCase):
expected = 'Error!' expected = 'Error!'
assert response.status_code == status.HTTP_400_BAD_REQUEST assert response.status_code == status.HTTP_400_BAD_REQUEST
assert response.data == expected assert response.data == expected
class TestCustomSettings(TestCase):
def setUp(self):
self.view = OverridenSettingsView.as_view()
def test_get_exception_handler(self):
request = factory.get('/', content_type='application/json')
response = self.view(request)
assert response.status_code == 400
assert response.data == {'error': 'SyntaxError'}

View File

@ -26,7 +26,7 @@ deps =
django18: Django>=1.8,<1.9 django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10 django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11 django110: Django>=1.10,<1.11
django111: Django>=1.11rc1,<2.0 django111: Django>=1.11,<2.0
djangomaster: https://github.com/django/django/archive/master.tar.gz djangomaster: https://github.com/django/django/archive/master.tar.gz
-rrequirements/requirements-testing.txt -rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt -rrequirements/requirements-optionals.txt