Audit log and tracking changes - usnistgov/NEMO GitHub Wiki
If you want to track who and what changes are made to NEMO's data, we recommend setting up and using the excellent plugin Django Auditlog
It can be set in 3 steps:
- Add
'auditlog'
in your settings'INSTALLED_APPS
- Add
'NEMO.middleware.NEMOAuditlogMiddleware'
to your settings'MIDDLEWARE
- Define what you want to track in your
settings.py
:
AUDITLOG_INCLUDE_TRACKING_MODELS = [
# Track access expiration for users as well as role changes
{
"model": "NEMO.User",
"include_fields": ["access_expiration", "is_staff", "is_user_office", "is_accounting_officer", "is_service_personnel", "is_technician", "is_facility_manager", "is_superuser"],
},
# Track all changes on PhysicalAccessLevel
"NEMO.PhysicalAccessLevel",
]
NEMO Model names and fields can be found in models.py
The log entries will be available in Detailed administration -> AUDIT LOG -> Log entries
For Users, the user history will include the user's tracked data