From the course: Securing Django Applications
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Adding activity logs for auditing - Django Tutorial
From the course: Securing Django Applications
Adding activity logs for auditing
- [Instructor] Whenever a user changed some model in our system, we want to make sure that we log this action. The idea is that if there ever is a need for auditing, we have a log of activity that took place on the user's account or on their data. We start by creating the activity log model. The user is a foreign key to the user instance that modified or updated or performed whatever action it is we're logging here. And the action is a description of the action that took place. So, whenever we save a booking, we're going to be creating an activity log. The user is the user who created the booking, and then we actually create the activity log, and the action description will be user with an ID and email address, saved a booking with this particular ID. So we have the user ID, their email address, and then the booking ID. And then we add the activity log model to the Jango admin. Create the activity log model admin as…
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
-
-
-
Setting up per-object permissions in Django59s
-
Enabling per-object permissions in Django3m 47s
-
Unit test for per-object permissions in Django2m 48s
-
Creating a group permissions model4m 27s
-
Unit test for access control and group permissions3m 38s
-
Adding activity logs for auditing3m 4s
-
Deleting objects in an audit/compliance-compatible way3m 46s
-
-
-
-
-
-