Skip to main content

Audit trail for django models

Project description

What It Does

Lets you keep track of who changed what model instance in you Django application. Full model structure is tracked and kept in a separate table similar in structure to the original model table.

Let’s say a user logs in the admin and adds a Product model instance. The audit log will track this in a separate table with the exact structure of you Product table plus a reference to the user, the time of the action and type of action indicating it was an insert.

Next the user does an update of the same Product instance. The audit log table will keep the previous entry and another one will be added reflecting the change.

When the user deletes the same model instance the audit log table will have an entry indicating this with the state of the model before it was deleted.

What It Doesn’t Do

The audit log bootstraps itself on each POST, PUT or DELETE request. So it can only track changes to model instances when they are made via the web interface of your application. Note: issuing a delete in a PUT request will work without a problem (but don’t do that). Saving model instances through the Django shell for instance won’t reflect anything in the audit log. Neither will direct INSERT, UPDATE or DELETE statements, either within a request lifecycle or directly in your database shell.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-audit-log-0.2.2.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file django-audit-log-0.2.2.tar.gz.

File metadata

File hashes

Hashes for django-audit-log-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3f13ae8a426a0f4d1ba062312df4e53ba7ca52816d6e53cefb491eb4d07e659b
MD5 023dec2fd2ee4e51b15c740e8bc09f23
BLAKE2b-256 2f72845525aa435c3d5df79e442fab1b93c9ea038b7e15d3f4b9bfe0e3e19715

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page