Learn how to create a DELETE HTTP method URL route by exploring the URL configuration and DestroyAPIView subclass.
- [Instructor] Let's connect the destroy product … API view to the router, … so that we can start using it in our API. … In the URL's configuration we add a new URL path … with the lookup field … so that we can destroy a product … using the ProductDestroy API view. … With the server running let's try this out on the browser. … First we find the ID of an existing product, … and then we can delete the product. … We click the destroy button and confirm the action. … We can also delete products … through a curl command on the command line. … Let's create a new product and then delete it. … We use the POST method to create the product … as we did before. … The product is created, … so now we can use the returned ID and delete it. … So, we use the DELETE method … with our URL for product deletion. … And then hit enter, … and it looks like the product is deleted now. … And that's how we delete a product through the browser, … and through the command line using the REST API. … …
- Creating a serializer
- Working with API views
- Filtering back ends
- Enabling pagination
- Executing CRUD operations
- Managing serializer fields
- Testing API views
Skill Level Intermediate
Deploying Django Apps: Make Your Site Go Livewith Nick Walter2h 43m Intermediate
Demo project overview1m 19s
1. Serializing, Listing, Filtering, and Paginating Models
2. Create, Retrieve, Update, and Delete (CRUD) Operations for Models
3. Managing Serializer Fields, Relations, and Validation
4. Testing API Views
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.