Update README.md (#8592)

* Update README.md

* revert ViewSet change

Co-authored-by: Adam Johnson <me@adamj.eu>
This commit is contained in:
Géry Ogam 2022-08-30 13:30:42 +02:00 committed by GitHub
parent 72e66e4d67
commit 5bf338ea88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,9 +90,10 @@ Startup up a new project like so...
Now edit the `example/urls.py` module in your project: Now edit the `example/urls.py` module in your project:
```python ```python
from django.urls import path, include
from django.contrib.auth.models import User from django.contrib.auth.models import User
from rest_framework import serializers, viewsets, routers from django.urls import include, path
from rest_framework import routers, serializers, viewsets
# Serializers define the API representation. # Serializers define the API representation.
class UserSerializer(serializers.HyperlinkedModelSerializer): class UserSerializer(serializers.HyperlinkedModelSerializer):
@ -111,7 +112,6 @@ class UserViewSet(viewsets.ModelViewSet):
router = routers.DefaultRouter() router = routers.DefaultRouter()
router.register(r'users', UserViewSet) router.register(r'users', UserViewSet)
# Wire up our API using automatic URL routing. # Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API. # Additionally, we include login URLs for the browsable API.
urlpatterns = [ urlpatterns = [