From 6ea6e37ac999025c8ee71fbc52764c1fd877c736 Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Sat, 27 Feb 2016 00:51:35 +0100 Subject: [PATCH 1/5] Add missing migration file for #3887 --- .../migrations/0002_auto_20160226_1747.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 rest_framework/authtoken/migrations/0002_auto_20160226_1747.py diff --git a/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py b/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py new file mode 100644 index 000000000..5673f332f --- /dev/null +++ b/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + ('authtoken', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='token', + options={'verbose_name_plural': 'Tokens', 'verbose_name': 'Token'}, + ), + migrations.AlterField( + model_name='token', + name='created', + field=models.DateTimeField(verbose_name='Created', auto_now_add=True), + ), + migrations.AlterField( + model_name='token', + name='key', + field=models.CharField(verbose_name='Key', max_length=40, primary_key=True, serialize=False), + ), + migrations.AlterField( + model_name='token', + name='user', + field=models.OneToOneField(to=settings.AUTH_USER_MODEL, verbose_name='User', related_name='auth_token'), + ), + ] From 753f4dc4771b07fcfdfd438655a78c089551d019 Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Sat, 27 Feb 2016 01:46:59 +0100 Subject: [PATCH 2/5] Fix sorting order. --- rest_framework/authtoken/migrations/0002_auto_20160226_1747.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py b/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py index 5673f332f..98e0bb670 100644 --- a/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py +++ b/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.db import migrations, models from django.conf import settings +from django.db import migrations, models class Migration(migrations.Migration): From 05204333a58ef1cb7c5809e5b04875b6161d6e8c Mon Sep 17 00:00:00 2001 From: Liping Wang <1325266543@qq.com> Date: Mon, 29 Feb 2016 19:51:33 +0800 Subject: [PATCH 3/5] [FIX] "@api_view" calling error. "@api_view" usage error. --- docs/tutorial/5-relationships-and-hyperlinked-apis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md index feef1fcf0..fb5f62fd3 100644 --- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md +++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md @@ -11,7 +11,7 @@ Right now we have endpoints for 'snippets' and 'users', but we don't have a sing from rest_framework.reverse import reverse - @api_view(('GET',)) + @api_view(['GET',]) def api_root(request, format=None): return Response({ 'users': reverse('user-list', request=request, format=format), From 239815887dacb29bfafd7dae6bc39c113bf13789 Mon Sep 17 00:00:00 2001 From: Liping Wang <1325266543@qq.com> Date: Tue, 1 Mar 2016 15:46:20 +0800 Subject: [PATCH 4/5] remove comma remove comma --- docs/tutorial/5-relationships-and-hyperlinked-apis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/5-relationships-and-hyperlinked-apis.md b/docs/tutorial/5-relationships-and-hyperlinked-apis.md index fb5f62fd3..4b9347bfa 100644 --- a/docs/tutorial/5-relationships-and-hyperlinked-apis.md +++ b/docs/tutorial/5-relationships-and-hyperlinked-apis.md @@ -11,7 +11,7 @@ Right now we have endpoints for 'snippets' and 'users', but we don't have a sing from rest_framework.reverse import reverse - @api_view(['GET',]) + @api_view(['GET']) def api_root(request, format=None): return Response({ 'users': reverse('user-list', request=request, format=format), From f3b4cb59515f10fd93b5d66718d40a2e8975f19f Mon Sep 17 00:00:00 2001 From: Rex Kerr <(none)> Date: Sat, 27 Feb 2016 12:41:56 -0800 Subject: [PATCH 5/5] Fixes incorrect references to URLPathVersioning --- docs/api-guide/versioning.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-guide/versioning.md b/docs/api-guide/versioning.md index bd63c974b..df5d5dfbc 100644 --- a/docs/api-guide/versioning.md +++ b/docs/api-guide/versioning.md @@ -143,7 +143,7 @@ Your URL conf must include a pattern that matches the version with a `'version'` ## NamespaceVersioning -To the client, this scheme is the same as `URLParameterVersioning`. The only difference is how it is configured in your Django application, as it uses URL namespacing, instead of URL keyword arguments. +To the client, this scheme is the same as `URLPathVersioning`. The only difference is how it is configured in your Django application, as it uses URL namespacing, instead of URL keyword arguments. GET /v1/something/ HTTP/1.1 Host: example.com @@ -165,7 +165,7 @@ In the following example we're giving a set of views two different possible URL url(r'^v2/bookings/', include('bookings.urls', namespace='v2')) ] -Both `URLParameterVersioning` and `NamespaceVersioning` are reasonable if you just need a simple versioning scheme. The `URLParameterVersioning` approach might be better suitable for small ad-hoc projects, and the `NamespaceVersioning` is probably easier to manage for larger projects. +Both `URLPathVersioning` and `NamespaceVersioning` are reasonable if you just need a simple versioning scheme. The `URLPathVersioning` approach might be better suitable for small ad-hoc projects, and the `NamespaceVersioning` is probably easier to manage for larger projects. ## HostNameVersioning