I'm trying to have logs on one of my models by using the django-audit-log
package. I've installed the package using pip and added 'audit_log.middleware.UserLoggingMiddleware',
to my middleware classes in my settings.py
In my models.py
file, I have imported the necessary...
from audit_log.models.fields import LastUserField, LastSessionKeyField
class Transaction(models.Model):
title = models.CharField(max_length=100)
updated_by = LastUserField()
update_session = LastSessionKeyField()
This is exactly how they have implemented those fields in the documentation at https://django-audit-log.readthedocs.io/en/0.7.0/change_tracking.html#tracking-who-made-the-last-changes-to-a-model
Hence I can't see what I'm doing wrong. Even when I update the updated_by
field to include the on_delete
argument, I get the same error when I try and make migrations.
What am I missing?