drf-api-tracking
drf-api-tracking copied to clipboard
requested_at and remote_addr fields in base_model are not null
copied over from: https://github.com/aschn/drf-tracking/issues/141
In my case, when has IP white lists, the program can't get the remote_addr. But in the base_model, the field is setted to not null. remote_addr = models.GenericIPAddressField() the requested_at is the same. requested_at = models.DateTimeField(db_index=True) @niubencoolboy Author niubencoolboy commented on 24 Jun 2019
So, I changed the two codes to blew: from django.utils.timezone import now
requested_at = models.DateTimeField(default=now, db_index=True)
remote_addr = models.GenericIPAddressField(null=True, blank=True)