From the course: Building RESTful Web APIs with Django
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Connecting an UpdateAPIView to the router
From the course: Building RESTful Web APIs with Django
Connecting an UpdateAPIView to the router
- [Instructor] We refactored the destroy API view and now we have to update the URL configuration to reflect the refactoring. In our URL patterns configuration, we are going to remove the destroy API view and replace it with the retrieve update destroy API view. First we replace the view and we update the URL and that's it. Now let's see how this looks in the browser. Go to one product and retrieve its data. As you can see, we have retrieve, update, and destroy. Let's try changing the name. So we renamed the product and we can also change the price. And now let's delete this product. As you can see, we use Django REST framework's built in views, to make implementing common REST API operations very quick and easy to do.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Creating a CreateAPIView subclass2m 53s
-
(Locked)
Connecting a CreateAPIView to the router2m 1s
-
(Locked)
Creating a DestroyAPIView subclass2m 18s
-
(Locked)
Connecting a DestroyAPIView to the router2m 7s
-
(Locked)
Creating an UpdateAPIView subclass3m 35s
-
(Locked)
Connecting an UpdateAPIView to the router1m 22s
-
(Locked)
-
-
-