Yet another Django audit log app, hopefully the simplest one.
-
Install django-easy-audit by running:
pip install django-easy-audit
Alternatively, you can download the code from Github, and place the folder 'easyaudit' in the root of your project.
-
Add "easyaudit" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'easyaudit',
]
- Add django-easy-audit's middleware to your MIDDLEWARE_CLASSES setting like this:
MIDDLEWARE_CLASSES = (
...
'easyaudit.middleware.easyaudit.EasyAuditMiddleware',
)
-
Run
python manage.py migrate easyaudit
to create the audit models. -
That's it! Now every CRUD event on your whole project will be registered in the audit models, which you will be able to query from the Django admin app. Additionally, this app will also log everytime a user logs in, out or fails to login.
django-easy-audit uses Django signals to listen to the events going on in your project, such as when a user creates, updates or deletes a registry. This applies to every model of every app your project is using.
When any of these events takes place, django-easy-audit will log it in the model CRUDEvent
.
Besides logging CRUD events, django-easy-audit will log every time your users log in, out,
or fail to log in. This information is stored in the model LoginEvent
.
You can query this information in the Django Admin app.