diff --git a/README.md b/README.md index e71fe7bf1..ec13e1b33 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ There is a live example API for testing purposes, [available here][sandbox]. # Requirements -* Python (2.6.5+, 2.7, 3.2, 3.3) +* Python (2.6.5+, 2.7, 3.2, 3.3, 3.4) * Django (1.4.11+, 1.5.5+, 1.6, 1.7) # Installation diff --git a/docs/api-guide/authentication.md b/docs/api-guide/authentication.md index 0ec5bad10..b355012e1 100755 --- a/docs/api-guide/authentication.md +++ b/docs/api-guide/authentication.md @@ -415,6 +415,10 @@ The [HawkREST][hawkrest] library builds on the [Mohawk][mohawk] library to let y HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a way to achieve origin authentication and message integrity for HTTP messages. Similar to [Amazon's HTTP Signature scheme][amazon-http-signature], used by many of its services, it permits stateless, per-request authentication. [Elvio Toccalino][etoccalino] maintains the [djangorestframework-httpsignature][djangorestframework-httpsignature] package which provides an easy to use HTTP Signature Authentication mechanism. +## Djoser + +[Djoser][djoser] library provides a set of views to handle basic actions such as registration, login, logout, password reset and account activation. The package works with a custom user model and it uses token based authentication. This is a ready to use REST implementation of Django authentication system. + [cite]: http://jacobian.org/writing/rest-worst-practices/ [http401]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2 [http403]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4 @@ -449,3 +453,4 @@ HTTP Signature (currently a [IETF draft][http-signature-ietf-draft]) provides a [hawk]: https://github.com/hueniverse/hawk [mohawk]: http://mohawk.readthedocs.org/en/latest/ [mac]: http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token-05 +[djoser]: https://github.com/sunscrapers/djoser diff --git a/docs/index.md b/docs/index.md index 161886a4e..5b31cc830 100644 --- a/docs/index.md +++ b/docs/index.md @@ -49,7 +49,7 @@ Some reasons you might want to use REST framework: REST framework requires the following: -* Python (2.6.5+, 2.7, 3.2, 3.3) +* Python (2.6.5+, 2.7, 3.2, 3.3, 3.4) * Django (1.4.11+, 1.5.5+, 1.6, 1.7) The following packages are optional: diff --git a/docs/topics/2.4-announcement.md b/docs/topics/2.4-announcement.md index d8aa5b108..f38c743c0 100644 --- a/docs/topics/2.4-announcement.md +++ b/docs/topics/2.4-announcement.md @@ -164,8 +164,8 @@ Once again, many thanks to all the generous [backers and sponsors][kickstarter-s [lts-releases]: https://docs.djangoproject.com/en/dev/internals/release-process/#long-term-support-lts-releases [2-4-release-notes]: release-notes#240 -[view-name-and-description-settings]: ../api-guide/settings/#view-names-and-descriptions -[client-ip-identification]: ../api-guide/throttling/#how-clients-are-identified +[view-name-and-description-settings]: ../api-guide/settings#view-names-and-descriptions +[client-ip-identification]: ../api-guide/throttling#how-clients-are-identified [2-3-announcement]: 2.3-announcement [github-labels]: https://github.com/tomchristie/django-rest-framework/issues [github-milestones]: https://github.com/tomchristie/django-rest-framework/milestones diff --git a/docs/topics/contributing.md b/docs/topics/contributing.md index 50b8ded16..96d9a98c0 100644 --- a/docs/topics/contributing.md +++ b/docs/topics/contributing.md @@ -210,7 +210,9 @@ We recommend the [`django-reusable-app`][django-reusable-app] template as a good ## Linking to your package -Once your package is decently documented and available on PyPI open a pull request or issue, and we'll add a link to it from the main REST framework documentation. +Once your package is decently documented and available on PyPI open a pull request or issue, and we'll add a link to it from the main REST framework documentation. You can add your package under **Third party packages** of the API Guide section that best applies, like [Authentication][authentication] or [Permissions][permissions]. You can also link your package under the [Third Party Resources][third-party-resources] section. + +We also suggest adding it to the [REST Framework][rest-framework-grid] grid on Django Packages. [cite]: http://www.w3.org/People/Berners-Lee/FAQ.html [code-of-conduct]: https://www.djangoproject.com/conduct/ @@ -225,3 +227,7 @@ Once your package is decently documented and available on PyPI open a pull reque [docs]: https://github.com/tomchristie/django-rest-framework/tree/master/docs [mou]: http://mouapp.com/ [django-reusable-app]: https://github.com/dabapps/django-reusable-app +[authentication]: ../api-guide/authentication.md +[permissions]: ../api-guide/permissions.md +[third-party-resources]: third-party-resources.md +[rest-framework-grid]: https://www.djangopackages.com/grids/g/django-rest-framework/ diff --git a/docs/topics/third-party-resources.md b/docs/topics/third-party-resources.md index 1ca917427..0317dd64c 100644 --- a/docs/topics/third-party-resources.md +++ b/docs/topics/third-party-resources.md @@ -16,6 +16,7 @@ To submit new content, [open an issue](https://github.com/tomchristie/django-res * [djangorestframework-jwt](https://github.com/GetBlimp/django-rest-framework-jwt) - Provides JSON Web Token Authentication support. * [hawkrest](https://github.com/kumar303/hawkrest) - Provides Hawk HTTP Authorization. * [djangorestframework-httpsignature](https://github.com/etoccalino/django-rest-framework-httpsignature) - Provides an easy to use HTTP Signature Authentication mechanism. +* [djoser](https://github.com/sunscrapers/djoser) - Provides a set of views to handle basic actions such as registration, login, logout, password reset and account activation. ### Permissions diff --git a/rest_framework/routers.py b/rest_framework/routers.py index f2d062118..169e6e8bc 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -20,6 +20,7 @@ from collections import namedtuple from django.conf.urls import patterns, url from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import NoReverseMatch +from django.utils.datastructures import SortedDict from rest_framework import views from rest_framework.response import Response from rest_framework.reverse import reverse @@ -277,7 +278,7 @@ class DefaultRouter(SimpleRouter): """ Return a view to use as the API root. """ - api_root_dict = {} + api_root_dict = SortedDict() list_name = self.routes[0].name for prefix, viewset, basename in self.registry: api_root_dict[prefix] = list_name.format(basename=basename) @@ -286,7 +287,7 @@ class DefaultRouter(SimpleRouter): _ignore_model_permissions = True def get(self, request, *args, **kwargs): - ret = {} + ret = SortedDict() for key, url_name in api_root_dict.items(): try: ret[key] = reverse( diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html index 58e7e86cd..e9d99a659 100644 --- a/rest_framework/templates/rest_framework/base.html +++ b/rest_framework/templates/rest_framework/base.html @@ -140,16 +140,16 @@ {% if post_form %} {% endif %}
{% if post_form %} -
+
{% with form=post_form %}
@@ -164,7 +164,7 @@ {% endwith %}
{% endif %} -
+
{% with form=raw_data_post_form %}
@@ -186,16 +186,16 @@ {% if put_form %} {% endif %}
{% if put_form %} -
+
@@ -209,7 +209,7 @@
{% endif %} -
+
{% with form=raw_data_put_or_patch_form %}