0

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?

Kingsley
  • 777
  • 1
  • 12
  • 35
  • Can you show the error traces? – Ishwar Jangid Feb 07 '19 at 05:50
  • I've decided that I don't need the package so I've gone ahead and implemented the `def save_model(self, request, obj, form, change):` method in my model admin and I've gotten rid of the package entirely. – Kingsley Feb 07 '19 at 06:09

0 Answers0