Need help with django-audit-log?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

218 Stars 80 Forks BSD 3-Clause "New" or "Revised" License 102 Commits 33 Opened issues


Audit log for your Django models

Services available


Need anything else?

Contributors list

.. image:: :target: :alt: Documentation Status

.. image:: Chat.svg :target:

.. image:: :target: :alt: Latest Version

.. image:: :target: :alt: Supported Python versions

.. image:: :target: :alt: Download format



Tracking changes to django models.

  • Model fields for keeping track of the user and session that created and modified a model instance.
  • Abstract model class with fields
  • A model manager class that can automatically track changes made to a model in the database.
  • Support for Django 1.6 and 1.7, South migrations, Django 1.7 migrations and custom User classes.
  • Python 3 and 2.x support

The documentation can be found here 

Tracking full model history on M2M relations is not supported yet. Version 0.3.0 onwards is tested with Django 1.6. It should work with older versions of Django, but may break things unexpectedly!

Quickstart Guide

Install it with pip from PyPi::

pip install django-audit-log


to your

To just track who created or edited a model instance just make it inherit from

from audit_log.models import AuthStampedModel

class WarehouseEntry(AuthStampedModel): product = models.ForeignKey(Product) quantity = models.DecimalField(max_digits = 10, decimal_places = 2)

This will add 4 fields to the

  • created_by
    - A foreign key to the user that created the model instance.
  • created_with_session_key
    - Stores the session key with which the model instance was first created.
  • modified_by
    - A foreign key to the user that last saved a model instance.
  • modified_with_session_key
    - Stores the session key with which the model instance was last saved.

If you want to track full model change history you need to attach an

manager to the model::
from django.db import models
from audit_log.models.fields import LastUserField
from audit_log.models.managers import AuditLog

class ProductCategory(models.Model): name = models.CharField(max_length=150, primary_key = True) description = models.TextField()

audit_log = AuditLog()

class Product(models.Model): name = models.CharField(max_length = 150) description = models.TextField() price = models.DecimalField(max_digits = 10, decimal_places = 2) category = models.ForeignKey(ProductCategory)

audit_log = AuditLog()

You can then query the audit log::

In [2]: Product.audit_log.all()
Out[2]: [,

The documentation can be found here 

Note: This project was not maintained actively for a while. One of the reasons was that I wasn't receiving email notifications from GitHub. The other reason: We were using it just on a couple of projects that were frozen to old versions of Django. If you need any help with the project you can contact me by email directly if I don't respond to your GitHub issues. Feel free to nudge me over email if you have a patch for something. You can find my email in the AUTHORS file.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.