When a flood of requests happens, you can delay performing an action instead of performing it immediately. In this video, learn how to use a background task queue to accomplish this.
- In our web app, users want the ability … to post comments several times a day, … about the tour packages offered. … It's possible that this could lead to a flood … of requests from millions of users … or from very active users. … Our background task will create … a new comment for the user, … which allows us to scale up and handle more requests. … So we're going to import … the comment model. … And we're going to define … a new background task, … called create comment. … That is given a user ID and the text of the comment. … And we're going to define a cache key, … for the user. … And if the cache key is already set, … then we going to say we need to retry this task later. … So this will only work, if the task is bound. … This is why we have bind equals true … while we're defining the task. So, … if the key does not exist, … that means we are free … to create, … our new comment. … And we use the user ID to get the user … and the text of the comment will be the given text. … And then we save the object. …
Skill Level Advanced
Building a Paid Membership Site with Djangowith Nick Walter1h 15m Intermediate
OWASP Top 10: #7 XSS and #8 Insecure Deserializationwith Caroline Wong26m 31s Intermediate
Building RESTful Web APIs with Djangowith Rudolf Olah1h 9m Intermediate
1. Permissions, Access Controls, Activity Logs
2. Throttling a Flood of Requests
3. Protecting Data and Data Privacy
4. 2FA: Two-Factor Authentication
5. CSRF: Cross-Site Request Forgery Protection
- 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.