From the course: Securing Django Applications
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Deleting objects in an audit/compliance-compatible way - Django Tutorial
From the course: Securing Django Applications
Deleting objects in an audit/compliance-compatible way
- [Instructor] When deleting data in a Django app we need to be aware of compliance requirements and whether the data can be truly deleted. We create a new data model, which will store a copy of the deleted data. So we need to store the model type that was deleted. And then we have to store the ID of the model that was deleted. And then we store the actual data. And now whenever we delete a booking model instance, we're going to be archiving it, and storing it in the DeletedData model. Now we do this by using DJango serializers and we're going to store a JSON copy of this instance that was deleted, and then we're going to store it in the DeletedData objects. So the model type is booking. The model ID is the instance ID, and the data is the serialized version of that data. Later on, if we ever need to recover this data, and restore it, we can do that just given the ID. We can find it in deleted data. Say that the…
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
-
(Locked)
Enabling per-object permissions in Django3m 47s
-
(Locked)
Unit test for per-object permissions in Django2m 48s
-
(Locked)
Creating a group permissions model4m 27s
-
(Locked)
Unit test for access control and group permissions3m 38s
-
(Locked)
Adding activity logs for auditing3m 4s
-
(Locked)
Deleting objects in an audit/compliance-compatible way3m 46s
-
-
-
-
-
-