Put 'url' field back in to UserSerializer example, added warning about using namespace when including router urls.

This commit is contained in:
Ian MacLeod 2015-11-17 16:21:08 -08:00
parent 58b5e86827
commit 9c7411cfc1
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ from rest_framework import serializers, viewsets, routers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('username', 'email', 'is_staff')
fields = ('url', 'username', 'email', 'is_staff')
# ViewSets define the view behavior.

View File

@ -135,7 +135,7 @@ Here's our project's root `urls.py` module:
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
You can now open the API in your browser at [http://127.0.0.1:8000/](http://127.0.0.1:8000/), and view your new 'users' API. If you use the login control in the top right corner you'll also be able to add, create and delete users from the system.
Do not use a namespace when you include your router urls as they are not currently supported. You can now open the API in your browser at [http://127.0.0.1:8000/](http://127.0.0.1:8000/), and view your new 'users' API. If you use the login control in the top right corner you'll also be able to add, create and delete users from the system.
## Quickstart