mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Merge pull request #1157 from dpetzel/tutorial_authentication
Be sure to import UserSerializer
This commit is contained in:
commit
97fbc5caec
|
@ -75,6 +75,10 @@ We'll also add a couple of views. We'd like to just use read-only views for the
|
|||
class UserDetail(generics.RetrieveAPIView):
|
||||
queryset = User.objects.all()
|
||||
serializer_class = UserSerializer
|
||||
|
||||
Make sure to also import the `UserSerializer` class
|
||||
|
||||
from snippets.serializers import UserSerializer
|
||||
|
||||
Finally we need to add those views into the API, by referencing them from the URL conf.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user